jeudi 12 mars 2015

[Knockout] conditionally add attribute

data-bind="
    attr:{
     'selected': typeof(selected) !== 'undefined' ? 'selected' : null  
       }
"

Source : http://stackoverflow.com/questions/12963023/conditionally-add-an-element-attribute-in-knockout-js

Aucun commentaire:

Categories