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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -