knockout / knockout

Knockout makes it easier to create rich, responsive UIs with JavaScript
http://knockoutjs.com/
Other
10.44k stars 1.52k forks source link

Remove "data-bind" attribute when binding gets applied. #2511

Closed azaslonov closed 4 years ago

azaslonov commented 4 years ago

Hi guys, hope you're doing well.

Can you please tell what would be the proper approach to remove "data-bind" attribute, when (and only when) the binding declared by the attribute gets applied? Basically, I would like to cleanup HTML of a static website generated on the server. I know, I can just go through DOM and do the hand-picked removal, but ideally, it could be done through some kind of middleware (if something like this exists in KO).

Any help greatly appreciated.

mbest commented 4 years ago

Perhaps this answer on SO will help.

azaslonov commented 4 years ago

Great! Thank you.