How do I use Knockout native template engine to generate bound but not attached html elements for a given template and a view model?
I want to achieve something similar to:
var template = "<div data-bind="text: name"></div>";
var viewModel = { name: "Hello" };
var domNode = ko.applyBindings(template, viewModel);
$('body').append(domNode);
Yes, you can do this, but you should add dom element to the page first and then apply bindings:
Here is working fiddle: http://jsfiddle.net/mq2GU/