Skip to content

Instantly share code, notes, and snippets.

@johanvalcoog
Created January 14, 2012 18:15
Show Gist options
  • Save johanvalcoog/1612318 to your computer and use it in GitHub Desktop.
Save johanvalcoog/1612318 to your computer and use it in GitHub Desktop.
login states ember
ClientHub.loggedOutView = Em.View.extend({
templateName: "login",
LoginFormView: Em.View.extend({
errorMsg: null,
error: null,
username: null,
password: null,
submitLogin:function(){
ClientHub.LoginManager.send('login', {username: this.get('username'),
password: this.get('password')
})
}
}),
});
//inside the state manager
loginErrState : Em.State.create({
enter: function(manager, transition){
view = this.get('parentState').get('view').get('')
view.set('error', "There was a problem logging you in. Please try again.")
view.set('')
},
exit: function(manager, transition){
view = this.get('parentState').get('view').get('LoginFormView')
view.get.set('error', null)
},
}),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment