Created
September 1, 2014 02:28
-
-
Save zefei/09b7622d1c8a928d5c58 to your computer and use it in GitHub Desktop.
Example of using Meteor reactivity inside Angular: using Meteor accounts
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
// 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