Search code examples
javascripttemplatesmeteoriron-router

How to check current route in Iron Router Meteor


I'm setting up a body helper for use with Iron Router to use as {{route}}:

Template.body.helpers({
  route: function(){
    alert(Router.current().route.getName());
  }
});

But Router.current().route.getName() returns undefined instead of "/thirdPage/".


Solution

  • Try:

    Router.current().route.path()