![](/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.