Created
April 21, 2012 13:13
-
-
Save gabriel-dehan/2437032 to your computer and use it in GitHub Desktop.
Flash messenger with meteor 0.3.3
This file contains hidden or 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
Meteor.call('login', name, pass, function(error, user){ | |
if ( error ) { | |
Session.set('message', error.error + ': ' + error.reason); | |
} else { | |
Session.set('message', 'You are now connected, ' + user.name + '.'); | |
Session.set('user', user); | |
} | |
MyApp.navigate('/user/list'); | |
}); | |
MyApp = {} | |
MyApp.navigate = function(route) { | |
Router.navigate(route, {trigger: true}); | |
// OF COURSE, this won't work because it will flush the message immediately after the redirection (Because of the automatic update in the templates) | |
// So I would need to set it only on the next MyApp.navigate() call | |
Session.set('message', undefined); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment