bitovi/canjs — pull request #244 by retro (2013-01-19 13:02:06+00:00)
Title: Support for rendering document fragments (returned from the renderer function) in the templates

This change allows passing of document fragments directly to the template layer. They are live bound as they are never converted to the string. It allows syntax that looks like this:

var renderer = can.view.mustache('{{{ subview }}}');
var subview = can.view.mustache('Subview {{ foo }}');
var foo = can.compute("FOO")
var div = document.createElement('div');
div.appendChild(renderer({
subview : function(){
return subview({
foo : foo
})
}
}));

div.innerHTML // Subview FOO

foo("BAR")

div.innerHTML // Subview BAR