Skip to content

Instantly share code, notes, and snippets.

@zefei
Created September 1, 2014 02:28
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/09b7622d1c8a928d5c58 to your computer and use it in GitHub Desktop.
Save zefei/09b7622d1c8a928d5c58 to your computer and use it in GitHub Desktop.
Example of using Meteor reactivity inside Angular: using Meteor accounts
// a reactive block that depends on user account
autorun($scope, function() {
$scope.user = Meteor.user();
$scope.loggedIn = !!user;
});
...
// any of following lines will trigger the reactive block above
Meteor.loginWithPassword(myEmail, myPassword);
Accounts.createUser({email: myEmail, password: myPassword);
Meteor.logout();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment