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

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -