use*_*602 8 javascript meteor iron-router
我升级到Meteor 1.0,安装了最新的铁路由器包,尝试运行我的应用程序并在我的控制台日志中得到了这个好警告:
路线调度从未呈现.你忘了在onBeforeAction中调用this.next()吗?
所以我尝试根据新版本修改我的路线.
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)]}
});
Run Code Online (Sandbox Code Playgroud)
我怎样才能解决这个问题?任何帮助将不胜感激.
尝试删除所有.wait()s并删除onBefore函数周围的数组.
随着新的API this.next()取代.wait().