javascript - Meteor.js: iron:router including name -
in tutorials found 2 ways of using iron:router:
first one:
router.route("/", function(){ this.render("navbarmain", { to: "navigation" }); this.render("firstpage",{ to: "main" });
second one:
router.route("/", { name: "home", template: "home" });
i add name attribute first code; tried adding in differenet places, none seems work. should put or there no way combine two? in case, how can refer root page (in pathfor)?
this should work.
router.route("/", function(){ this.render("navbarmain", { to: "navigation" }); this.render("firstpage",{ to: "main" }); }, { name: 'home' });
Comments
Post a Comment