Binding a custom handler twice in knockoutjs
问题 I've written a custom binding handler to show a bootstrap popover in knockout: ko.bindingHandlers.popover = { init: function (element, valueAccessor, allBindings, viewModel, bindingContext) { $(element).popover({ html: true, content: function () { return $('#' + ko.unwrap(valueAccessor().template)).html(); }, placement: "right", trigger: "manual", container: 'body' }); }, update: function (element, valueAccessor, allBindings, viewModel, bindingContext) { if (valueAccessor().visible()) { $