Bakr
Bakr

Reputation: 11

the results is repeated in knockout

when I use the || in data-bind, it repeats the results when both are true, but separately work fine,

I tried in many ways and all give me the same and when I use with === no results return and without parentheses is the same result

<div data-bind="visible: (
  worktask.wbc_date == $root.FirstViewOnlyDate() || 
  worktask.wbc_date == null
)">

Upvotes: 1

Views: 60

Answers (1)

Danielle
Danielle

Reputation: 3839

Considering that FirstViewOnlyDate is an observable, did you try:

visible: (
  !worktask.wbc_date() && 
   worktask.wbc_date !== $root.FirstViewOnlyDate()
)

?

Upvotes: 1

Related Questions