Conditioning Knockout Observables: reject values
Wouldn’t it be nice if we could restrict the value written to a Knockout observable? Some values might mess up your model completely while others just don’t make sense. How would one create a conditioned observable that rejects invalid values? It turns out that conditioning an observable is not so hard.
Solving Knockout JS calculated bindings Syntax Error
Doing calculations on Knockout data-binds might result into a “Uncaught SyntaxError: Unable to parse bindings” error. Solution: use an anonymous function!