applying knockout bindings to PART of a page
normally knockout bindings are applied to the WHOLE page and only ONCE:
ko.applyBindings();
however if your UI is moving or creating and destroying DOM nodes, that you want to be bound via knockout:
then you will need to be able to unbind (clean) and to bind, on a DOM element level:
partial clean (unbind):
ko.cleanNode(myElement);
partial bind:
ko.applyBindings(viewModelOrBindingContext, myElement);
normally knockout bindings are applied to the WHOLE page and only ONCE:
ko.applyBindings();
however if your UI is moving or creating and destroying DOM nodes, that you want to be bound via knockout:
then you will need to be able to unbind (clean) and to bind, on a DOM element level:
partial clean (unbind):
ko.cleanNode(myElement);
partial bind:
ko.applyBindings(viewModelOrBindingContext, myElement);
Comments
Post a Comment