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

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

java - Using an Integer ArrayList in Android -