Created
June 13, 2017 08:14
-
-
Save renefs/9b3870513bc345c347d3111533985fb3 to your computer and use it in GitHub Desktop.
Yuidoc Ember example
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
import Ember from 'ember'; | |
/** | |
* The login controller shows the login form and sends authentication data to the session. | |
* | |
* @class login | |
* @namespace Controller | |
*/ | |
export default Ember.Controller.extend({ | |
/** | |
* The session service. | |
* | |
* @property session | |
* @readOnly | |
* @type Service | |
*/ | |
session: Ember.inject.service('session'), | |
/** | |
* The identification, usually an username or e-mailaddress. | |
* | |
* @property identification | |
* @type String | |
* @default null | |
*/ | |
identification: '', | |
/** | |
* The password. | |
* | |
* @property password | |
* @type String | |
* @default null | |
*/ | |
password: '', | |
actions: { | |
/** | |
* The authenticate action sends the identification and password to the session. | |
* | |
* @event authenticate | |
* @return undefined | |
*/ | |
authenticate() { | |
this.get('session').authenticate('authenticator:jwt', this.getProperties('identification', 'password')); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment