Reputation: 699
I am doing an OR check for the visibility of a control but it is not working as expected. Below is the code for the same.
<span data-bind="visible: (test1()==='a' || test() === 'a')>a</span>
var viewModel = {
test : ko.observable('a'),
test1 : ko.observable('a')
};
ko.applyBindings(viewModel);
Upvotes: 1
Views: 924
Reputation: 1304
You have not closed the quotes in your data-bind attribute value.
<span data-bind="visible: (test1()==='a' || test() === 'a')**"**>a</span>
The closing " was missing
Fiddle here
Upvotes: 2