【发布时间】:2014-11-01 20:15:31
【问题描述】:
我升级到 Meteor 1.0,安装了最新的 iron-router 包,尝试运行我的应用程序并在我的控制台日志中收到了这个很好的警告:
路由调度从未渲染。您是否忘记调用 this.next() 一个 onBeforeAction?
所以我尝试根据新版本修改我的路线。
this.route('gamePage', {
path: '/game/:slug/',
onBeforeAction: [function() {
this.subscribe('singlePlayer', this.params.slug).wait();
var singlePlayer = this.data();
if (singlePlayer) {
if (singlePlayer.upgrade) {
this.subscribe('upgrades', this.params.slug).wait();
this.next();
}
this.next();
}
this.next();
}],
data: function() {
return Games.findOne({slug: this.params.slug});
},
waitOn: function() { return [Meteor.subscribe('singleGame', this.params.slug)]}
});
我该如何解决这个问题? 任何帮助将不胜感激。
【问题讨论】:
标签: javascript meteor iron-router