Tuesday, April 19, 2016

Meteor Iron Router Page Reloading Using pathFor

Leave a Comment

I'm using Iron Router for my Meteor routing. I have an app layout that looks something like:

 <template name="appLayout">     {{> menu}}     {{> yield}}     {{> footer}} </template> 

Whenever I use the template helper <a href="{{pathFor route='profileView' id=user._id}}"></a> in my menu template, the entire app doesn't refresh or reload, it loads the template fine, we're good. It seems the issue arises when a pathFor is clicked in a template that's been loaded within the yield. How can I prevent the app from refreshing or reloading when trying to load these other templates? Why is it happening just from templates that are loading within the yield?

1 Answers

Answers 1

Basically iron router reload the page when url change.

I think your id=user._id, is depends on any subscription on your route waitOn function. So when your user._id change in the route the iron router will reload the page with the current subscription.

For prevent reload you can use methods call for getting your desire output from the server.

Let me know if It's solve your issue or not.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment