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

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -