admin管理员组文章数量:1355684
I upgraded to Meteor 1.0, installed the latest iron-router package, tried to run my app and got this nice warning in my console log:
Route dispatch never rendered. Did you forget to call this.next() in an onBeforeAction?
So I tried to modify my routes according to the new version.
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)]}
});
How can I fix this? Any help would be greatly appreciated.
I upgraded to Meteor 1.0, installed the latest iron-router package, tried to run my app and got this nice warning in my console log:
Route dispatch never rendered. Did you forget to call this.next() in an onBeforeAction?
So I tried to modify my routes according to the new version.
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)]}
});
How can I fix this? Any help would be greatly appreciated.
Share Improve this question asked Nov 1, 2014 at 20:15 user3475602user3475602 1,2172 gold badges22 silver badges43 bronze badges1 Answer
Reset to default 9Try removing all the .wait()
s and removing the array around your onBefore function.
With the new API this.next()
replaces .wait()
.
本文标签: javascriptTotally confused about thisnext() in Meteor ironrouterStack Overflow
版权声明:本文标题:javascript - Totally confused about this.next() in Meteor iron-router - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743996347a2573059.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论