I am wanting to update a view dynamically by applying applyBindingsToNode to it but it seems it must have a data-bind attached to it? Is that true? What if I have a button and another but开发者_运维百科ton with click events that needed to be registed by knockout.js. Would I have to call applyBindingsToNode to both of the buttons?
ko.applyBindingsToNode(element1, null, app.viewModel);
ko.applyBindingsToNode(element2, null, app.viewModel);
You can call ko.applyBindings(viewModel, element) on a parent element and it will apply bindings to it and anything under it.
精彩评论