Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First off, you may be missing the actual function name for the callback <a href="https://stackoverflow.com/questions/12879762/displaying-loader-while-meteor-collection-loads">as demonstrated in this post</a>.</p> <pre><code>Meteor.subscribe("myCollection", bar, function onComplete() { Session.set('stuffLoaded', true); }); </code></pre> <p>Which seems to be great practice. I don't usually miss a beat using this method.</p> <p>Secondly, I'm not sure subscriptions inside routes work well? I'd rather do the following:</p> <pre><code>'/myroute': function(bar) { Session.set("myCollectionParam", bar) return 'stuffPage'; } </code></pre> <p>So then the subsciption finally looks like this:</p> <pre><code> Meteor.subscribe("myCollection", Session.get("myCollectionParam"), function onComplete() { Session.set('stuffLoaded', true); }); </code></pre> <p><strong><em>OR</em></strong> (not sure which works correctly for you, depending on your publish function):</p> <pre><code> Meteor.subscribe("myCollection", {bar: Session.get("myCollectionParam")}, function onComplete() { Session.set('stuffLoaded', true); }); </code></pre> <p>Good luck!</p> <p><strong>EDIT</strong></p> <p>Just mentioning something about the publish function:</p> <p>While Session.get("myCollectionParam") could return null, you can ensure the behaviour a bit more by using the following publish method:</p> <pre><code>Meteor.publish("myCollection", function(myCollectionParam) { check(myCollectionParam, String); return MyCollection.find({_id: myCollectionParam}); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload