logo
down
shadow

howto route with collection's param in iron router Meteor JS


howto route with collection's param in iron router Meteor JS

By : Amir Mamaghani
Date : November 18 2020, 03:49 PM
I wish this helpful for you It is common way to route collection News as below using _id params,
code :
data: function(){ return News.findOne({name: this.params.name});}


Share : facebook icon twitter icon
How do you send info from 2 different collections to one route in iron-router for meteor?

How do you send info from 2 different collections to one route in iron-router for meteor?


By : pmsolla
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further How do you send info from 2 different collections to one route in iron-router for meteor? , You can easily assign them to parameters of the data object:
code :
Router.map(function() {
  this.route('detailedPost', {
    path: '/post/:id',
    data: function() {
      return {
        post: Posts.findOne(this.params._id),
        comments: Comments.find({postId: this.params._id}),
      };
    },
  });
});
Meteor|iron-router|what is the differences between Router.map and Router.route

Meteor|iron-router|what is the differences between Router.map and Router.route


By : Ashley
Date : March 29 2020, 07:55 AM
This might help you They are different ways of doing the same thing. Router.map is deprecated in the new iron router though, so you should use Router.route (though Router.map would work for the sake of backwards compatibility).
What is the first parameter of Router.route in Meteor's iron router?

What is the first parameter of Router.route in Meteor's iron router?


By : user3571098
Date : March 29 2020, 07:55 AM
around this issue There is no "correct" syntax as they are all accepted by iron:router, however, number 2 is arguably most commonly found because it's the one used in the guide after all.
Routing is all about URLs so I consider that defining a route by first indicating its path makes sense.
Meteor Iron-Router Registering helper with current route runs before router is loaded

Meteor Iron-Router Registering helper with current route runs before router is loaded


By : user3784364
Date : March 29 2020, 07:55 AM
it should still fix some issue Use technique called guarding:
code :
    // create global {{route}} helper
  Handlebars.registerHelper('route', function () {
    return Router.current() && 
           Router.current().route &&  
           Router.current().route.getName &&
           Router.current().route.getName();
  });
When meteor user logged in Iron Router will not route Router.current().params.username to different profile

When meteor user logged in Iron Router will not route Router.current().params.username to different profile


By : Melnikov Valeri
Date : March 29 2020, 07:55 AM
should help you out I want to thank everyone. I was able to fix the issue. This was due to an old line that I had inserted prior to building out my /:username route to collect the username router parameter. I ended up discovering that inside my Accounts.onLogin() I had a call that was doing...
shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org