Created
September 1, 2014 02:42
-
-
Save zefei/a5df71d4b7e4402029a6 to your computer and use it in GitHub Desktop.
Using Angular and Meteor together: use autorun wrapper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// inside your controller | |
autorun($scope, function() { | |
Meteor.subscribe('myMeteorCollection'); | |
$scope.myModel = MyMeteorCollection.find().fetch(); | |
}); |
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
I delete this "Meteor.subscribe('myMeteorCollection');"
it still can work.
I wanna know what dose this for?