Consider the following example:
ko.applyBindings(viewModel, document.getElementById('id'));
Is there some way via using knockout to get a list of "applied bindings?" I ask because I have a situation where I am getting the dreaded:
Uncaught Error: You cannot apply bindings multiple times to the same element.
Now its pretty obvious what the error means. How ever with how we do things, we load a view to the page via ajax and use the $(id).html(data)
to populate the page with the said view and then after use require js to load the view and then apply the bindings.
Now this works, until we navigate to another widget which, according to how we do things, should replace the current view and view model (binding) on the page. This is where I get the error.
So is there any way to see a current list of "applied bindings" in Knockout at the time it is trying to bind an view model to an element?