knockout.js - knockout binding how to remove an attribute -
let's have html element
<element testattribute='a'></element> i know can pass value of testattribute using binding this:
<element data-bind="attr: { testattribute: 'a'}></element> but how can remove attribute through binding. if original value
<element testattribute: 'a'></element> my end result should
<element></element>
the attr binding in ko remove attribute if value false, null, or undefined. so, if bind against observable , set 1 of values (not empty string), attribute removed.
Comments
Post a Comment