Is it possible to somehow take a DOM element from a underscore template and use it as another template?
The idea is that my app needs to render a document that contains
You can pass the nested template as a variable in the template assignments to the main template, e.g.:
HTML:
JS:
var renderSub = _.template( $('#sub_template').remove().text() ), renderMain = _.template( $('#main_template').remove().text() ); renderMain({num:5, renderSub:renderSub});