During the startup of my application, I instantiate a template with:
$someContainer.html(`<div data-bind="template: {name: 'my-template'}"></div>`);
and it works perfectly.
Now, during the application life, I destroy the content of $someContainer and later rerun the above code line to refill it.
But this time I see in place the <div data-bind="template: {name: 'my-template'}"></div> in the DOM, but Knockout has not been run on it to interpret its content.
The workaround I devised is to run ko.applyBindings(viewmodel, $sameContainer[0]); after recreation of the template.
I'm doing something wrong, or is there any better method?
Thanks for your help!
mario