Meteor 为什么Router.go不';t工作在观察回调上
我有这样一个模板:Meteor 为什么Router.go不';t工作在观察回调上,meteor,iron-router,Meteor,Iron Router,我有这样一个模板: Template.playDetails.created = function () { /* Catch removed documents and redirect client if happens */ Games.find({_id: gameId}).observe({ removed: function () { console.log("Ooops game deleted !"); Alerts("The ga
Template.playDetails.created = function () {
/* Catch removed documents and redirect client if happens */
Games.find({_id: gameId}).observe({
removed: function () {
console.log("Ooops game deleted !");
Alerts("The game was deleted by owner", "danger");
Router.go("playList");
}
});
};
当我删除游戏时,日志会显示在控制台上,但警报和Router.go都不起作用
我试着打电话给路由器。暂停,但这并没有改变任何事情
Meteor.setTimeout(function(){ Router.go('playList'); }, 10);
有什么我做得不好的吗?我在帖子中忘了,但是我当然得到了游戏ID,观察回调可以工作,因为我看到了登录控制台。如果你需要添加信息,你可以用小的“编辑”按钮编辑你的帖子。你有一个输入错误:
警报(“游戏被所有者删除”)
alert()
只接受一个参数-您有两个参数。另外,我们需要查看您的router.js
文件。有可能是路由器。go
不工作,因为没有名为播放列表的路由
@fuzzybabybunny我假设它不是默认的警报
,因为它是警报
…嗨,感谢您的巡演时间,因为kyll说这不是thédefaut警报,我有一个名为playList的路由(我在导航栏上使用它,并检查了名称,这是正确的:-/