Skip to content
Snippets Groups Projects
Commit 350c62aa authored by Max Henze's avatar Max Henze
Browse files

Documentation

parent 1bf57da6
No related branches found
No related tags found
No related merge requests found
import Controller from '@ember/controller';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object'
import { action } from '@ember/object';
/**
* Provides backend functionality for Login Route
*/
export default class LoginController extends Controller {
@tracked email = '';
@tracked password = '';
@tracked loginInvalid = false;
classLabel = 'is-invalid-label';
classInput = 'is-invalid-input';
/**
* Handles the user submitting the login form.
* Suppresses standard behaviour.
* Tests the email/password and updates the UI.
*/
@action
login(event) {
event.preventDefault();
if(this.email === 'test@example.com' && this.password === 'password') {
this.loginInvalid = false;
} else {
this.loginInvalid = true;
}
this.loginInvalid = false;
} else {
this.loginInvalid = true;
}
}
/**
* Handles the user typing in the email/password input fields.
* Resets the ''loginInvalid'' property to improve the usability.
*/
@action
typing() {
this.loginInvalid = false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment