if statement - knockout.js If condition is not working -
i've tried below scenarios, if condition not working properly.
<div data-bind="foreach: controlconfig" class=""> <!-- ko if: $data.title.tolowercase() == $root.prodversion.tolowercase() --> <span data-bind="text: $data.title" /> <div data-bind="text: $root.prodversion" /> <!--/ko--> </div> or <div data-bind="foreach: controlconfig" class=""> <!-- ko if: $data.title == $root.prodversion --> <span data-bind="text: $data.title" /> <div data-bind="text: $root.prodversion" /> <!--/ko--> </div> idea?
if title observable, need unwrap if you're using in expression: $data.title().tolowercase() , $data.title()==....
Comments
Post a Comment