【发布时间】:2015-02-21 21:16:30
【问题描述】:
流行的accounts-entry 包中有一个与铁路由器相关的错误。我相信 Iron-router 的更高版本更改为更好地用作中间件,因此请致电Router.routes
file 的第 87 行使用了以下代码:
_.each Router.routes, (route)->
exclusions.push route.name
# Change the fromWhere session variable when you leave a path
Router.onStop ->
# If the route is an entry route, no need to save it
if (!_.contains(exclusions, Router.current().route?.getName()))
Session.set('fromWhere', Router.current().path)
不幸的是,在 Router.routes 上执行 _.each 似乎不再是一种可行的解决方案,因为 Router.routes 不会返回并带有 .name 属性的对象。
最新的iron-router如何获得所有路线的名称?
【问题讨论】:
标签: meteor routing iron-router middleware