2

How to load multiple templates in Meteor JS ? I know how to load a single template dynamically. But not getting to load multiple Templates.Please see the below code of loading single template & suggest me what to do for Load Multiple Templates?

JS Code :

Meteor.startup(function () 
  {
    Session.set('currentTemplate', 'login');
  });
Template.content.helpers
({
    'renderTemplate': function()
    {
       if(Session.get('currentTemplate') == undefined)
       {
         Session.set('currentTemplate', 'login');
       }
        return new Handlebars.SafeString(Template[Session.get('currentTemplate')]({dataKey: '0'}));
    }
 })
1
  • You may want to consider using a router. Commented Jan 31, 2014 at 17:22

1 Answer 1

1

To load a template inside another one:

<template name="oneTemplate">
  {{> anotherTemplate}}
</template>

To load a different template depending on the url, it's better to use Iron Router.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.