My view model is returning a true value, and I'm trying to get my template to add CSS accordingly. The problem is, I can't find the syntax for a != true.
I have something like this:
<div data-bind="css: {'lw-touched': checked, 'lw-touch': !checked}"></div>
Which I thought would say, apply 'lw-touched' if checked === true, apply 'lw-touch' if checked === false. But that doesn't work :(. So I tried this:
<div data-bind="css: {'lw-touched': checked, 'lw-touch': checked !== true}"></div>
Which also didn't work.
I'm sure there is a way to do this! I just can't find it at the moment.
!checked(). Whenever you are negating an expression you need to get the underlying value using the parenthesis.