I am aware that ko.applyBindings
can take a second parameter which is the DOM element that it will bind to
but my case is different i have a big page i want to specify a viewmodel for it by using
ko.applyBindings(bigModel)
and then there is a small sidebar section which is in the middle of the page i want to specify another view model for it by using ko.applyBindings(smallModel, $("#sidebar")[0])
when i use bounded attributes using knockout in the small #sidebar
section it throws an error Unable to parse bindings
yet it still bind the values (Ex. <span 'text:propertyOnSmallModel' />
) i after that tried to add these attributes as empty attributes on the bigModel
, it didnt throw.
How can i apply this , use two view models one for the whole page and the other for a specific section