Created
January 14, 2012 18:15
-
-
Save johanvalcoog/1612318 to your computer and use it in GitHub Desktop.
login states ember
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
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