Meteor iron路由器中的next()对此完全困惑
Totally confused about this.next() in Meteor iron-router
我升级到Meteor 1.0,安装了最新的iron路由器包,尝试运行我的应用程序,并在控制台日志中收到了这个漂亮的警告:
从未呈现路由调度。你忘了在中调用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)]}
});
我该怎么解决这个问题?如有任何帮助,我们将不胜感激。
尝试删除所有.wait()
,并删除onBefore函数周围的数组。
使用新的API,this.next()
将取代.wait()
。
相关文章:
- 使用iron路由器服务器路由中的数据渲染模板
- iron路由器将参数添加到字符串中,并添加一个查询
- Iron:路由器在更改路由器上添加事件
- 无法读取流星中对象的属性's iron路由器's路线
- Meteor iron:路由器this.render()正在BeforeAction钩子中阻塞
- Meteor Iron路由器通过[data]vs[params]访问变量
- Meteor/Iron路由器-何时何地运行JS以交换到所见即所得
- 如何在Meteor Iron路由器的内部模板中访问全局数据
- Regex路由与Iron路由器
- Meteor,Iron:路由器在Router.go上传递多个属性
- Meteor Iron路由器如何获取POST数据
- 为什么我无法将数据传递到Iron路由器路由模板
- Meteor iron路由器中的next()对此完全困惑
- 用javascript中的iron路由器动态添加路由
- 当使用iron路由器时,当执行onRender时
- Meteor中的Iron路由器包问题
- Meteor/Iron路由器-在{{#each}}循环中获取父数据
- 使用iron路由器1.0.0-pre2版本下载文件链接
- iron路由器重新加载特定的头元素
- iron路由器在waitOn功能-Meteor中选择不同的订阅