Skip to content

Instantly share code, notes, and snippets.

@zefei
Created September 1, 2014 02:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zefei/a5df71d4b7e4402029a6 to your computer and use it in GitHub Desktop.
Save zefei/a5df71d4b7e4402029a6 to your computer and use it in GitHub Desktop.
Using Angular and Meteor together: use autorun wrapper
// inside your controller
autorun($scope, function() {
Meteor.subscribe('myMeteorCollection');
$scope.myModel = MyMeteorCollection.find().fetch();
});
@ziven27
Copy link

ziven27 commented Sep 22, 2014

I delete this "Meteor.subscribe('myMeteorCollection');"
it still can work.
I wanna know what dose this for?

@zefei
Copy link
Author

zefei commented Oct 14, 2014

Meteor.subscribe is needed once you remove autopublish from Meteor for production.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment