![](/img/trans.png)
[英]Meteor: Iron router not showing loading template when using Meteor._sleepForMs() in publication
[英]Meteor publication iron router
我在发布铁路由器时遇到问题。
似乎无法访问变量中的值
如果我尝试更换
Meteor.subscribe('singleMatch', id);
与
Meteor.subscribe('singleMatch', 463358926);
有用
这是我的代码https://gist.github.com/anonymous/8810102
注意:我为this.params创建了一个单独的变量,因为我无法访问属性
这里可能有两个问题:
我认为Meteor.subscribe('singleMatch', id)
应该是Meteor.subscribe('singleMatch', id).wait()
以便您的订阅实际上已经准备就绪,然后再继续。 这可能是您要寻找的元凶。
其次,我相信Meteor.call()
是异步的,因此无论您在回调中是否收到错误,您的路由都可以实际执行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.