Open derekchiang opened 11 years ago
Meteor has not yet loaded the data from the server.
Eventually the router will help you with this, but for now just ensure you don't throw errors when data is loading.
El 29/05/2013, a las 4:44 PM, "Derek Chiang (Enchi Jiang)" notifications@github.com escribió:
I'm experiencing a very strange issue and I wonder if that's caused by meteor-router. So apparently if I navigate to a page from the index by calling Meteor.Router.to, everything is good. But if I just go to the URL directly, all collections are missing (SomeCollection.find({}) returns an empty collection). Does anyone have any clue why?
I'm using Meteor 0.6.3 with the latest meteor-router.
— Reply to this email directly or view it on GitHub.
Thanks I see... what's the best way to get around this? Would you suggest me to use setTimeout
? But if the user is navigating from other pages to that route, in which case the data is loaded, then there is no need to make him wait. How do I detect whether a user is going directly to that route? Maybe by setting a session variable on other pages and check for the presence of the variable on that route? Any thoughts would be appreciated.
Hi Derek.
There are 3 levels of approaches.
{{#if post}}
to render nothing while you wait for the post to load. When the data arrives it'll reactively re-render as long as you haven't thrown an error.Good idea! Thanks a lot for help.
I'm experiencing a very strange issue and I wonder if that's caused by meteor-router. So apparently if I navigate to a page from the index by calling
Meteor.Router.to
, everything is good. But if I just go to the URL directly, all collections are missing (SomeCollection.find({}) returns an empty collection). Does anyone have any clue why?I'm using Meteor 0.6.3 with the latest meteor-router.