Adding cleanNode to Knockout static class #240

Closed
dealproc opened this Issue Sep 28, 2012 · 4 comments

Comments

Projects
None yet
3 participants
@dealproc

http://stackoverflow.com/questions/10048485/how-to-clear-remove-observable-bindings-in-knockout-js

Apparently, you're able to call :

ko.cleanNode(element);

to remove Knockout bindings from a particular element. This isn't documented on Knockoutjs.com, etc, but many people document it works. We should add this call to KnockoutJS

@michaelaird

This comment has been minimized.

Show comment
Hide comment
@michaelaird

michaelaird Sep 28, 2012

Contributor

I just had a quick glance in the code. ko.cleanNode is actually a shorthand for ko.utils.domNodeDisposal.cleanNode. would it be better to expose that object in Knockout.Utils ?

Contributor

michaelaird commented Sep 28, 2012

I just had a quick glance in the code. ko.cleanNode is actually a shorthand for ko.utils.domNodeDisposal.cleanNode. would it be better to expose that object in Knockout.Utils ?

@nikhilk

This comment has been minimized.

Show comment
Hide comment
@nikhilk

nikhilk Sep 28, 2012

Owner

Shorthand looks like better api... not just because it's shorter, but stuff like domNodeDisposal looks like internal implementation.

Owner

nikhilk commented Sep 28, 2012

Shorthand looks like better api... not just because it's shorter, but stuff like domNodeDisposal looks like internal implementation.

@dealproc

This comment has been minimized.

Show comment
Hide comment
@dealproc

dealproc Sep 30, 2012

I have the shorthand, but I made a mistake and put it as part of my main repos for this... how do I do a push to just give you those few lines, or do you want me to cut & paste it in a message, and you can just add it to the main repos @nikhilk ???

I have the shorthand, but I made a mistake and put it as part of my main repos for this... how do I do a push to just give you those few lines, or do you want me to cut & paste it in a message, and you can just add it to the main repos @nikhilk ???

@nikhilk

This comment has been minimized.

Show comment
Hide comment
@nikhilk

nikhilk Sep 30, 2012

Owner

I can copy the lines.

Owner

nikhilk commented Sep 30, 2012

I can copy the lines.

@nikhilk nikhilk closed this in d96257b Sep 30, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment