开发者

applyBindingsToNode and html bounds

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜