I would like the ability to load templates dynamically without explicitly specifying the template.
As an example:
>
Meteor 0.8.x Legacy
Using Joc's answer as a guide, I've achieved similar using http://docs.meteor.com/#template_call, but using a helper instead, as suggested by the docs:
When called inside a template helper, the body of Meteor.render, or other settings where reactive HTML is being generated, the resulting HTML is annotated so that it renders as reactive DOM elements
My client.js looks a bit like this:
Template.myPageTemplate.helpers({
dynamicTemplate: function() {
// conditional logic can be added here to determine which template to render
return Template.myDynamicTemplate();
}
});
and my html looks like this:
My Template
{{{dynamicTemplate}}}
My Dynamic Template