Meteor Iron Router 无法从 Route 获取当前路径

Meteor Iron Router does not get Current Path from Route

在模板助手中,我从 Iron.Router (iron:router) 获取当前路径,如下所示:

Router.current().route.path(this);

这很好用,除非路由路径确实包含参数 (e.g. /client/:_id/edit)。在这种情况下,path() 函数 returns null.

当路由包含参数时,如何在模板助手中获取当前路径?

有一些帖子讨论了这个问题,但那里提到的解决方案似乎不合适。

我在 iron:router1.0.7

中使用 Meteor 1.1.5

据此 iron-router/issues/289 当路径包含参数时会出现问题。使用 Iron.Location.get().path 的建议这对我来说效果很好。