while
while

Reputation: 3772

How to get path to a template in iron router

How can I get the path to a template in new version of iron-router for Meteor 1.0?

Before I could do this to get the current relative path:

Router.current().path

Now, as of meteor 1.0 it seems the path attribute has been removed.

How can I get the relative path to a template in iron-router?

Upvotes: 4

Views: 2802

Answers (2)

saimeunt
saimeunt

Reputation: 22696

Router.current().path

This has been moved to Router.current().location.get().path

See the iron:location package for more info on the location object.

https://github.com/EventedMind/iron-location

(this is added automatically by iron:router).

Upvotes: 9

none
none

Reputation: 1757

Maybe this will be helpful for you: Router.current().originalUrl or Router.current().url

Upvotes: 4

Related Questions