diff options
| author | crupest <crupest@outlook.com> | 2019-03-06 21:29:36 +0800 |
|---|---|---|
| committer | crupest <crupest@outlook.com> | 2019-03-06 21:29:36 +0800 |
| commit | 61844a348b2934321567b1457e6d05f318fc8b7e (patch) | |
| tree | afc70011a886cc325e7d742c05aba2a9982bcf5d /Timeline/ClientApp/src/app/user/user-login/user-login.component.ts | |
| parent | 1cf7cad30778e12fa0be22bf3b2acf5f75c6246a (diff) | |
| download | timeline-61844a348b2934321567b1457e6d05f318fc8b7e.tar.gz timeline-61844a348b2934321567b1457e6d05f318fc8b7e.tar.bz2 timeline-61844a348b2934321567b1457e6d05f318fc8b7e.zip | |
Reorganize file structure.
Diffstat (limited to 'Timeline/ClientApp/src/app/user/user-login/user-login.component.ts')
| -rw-r--r-- | Timeline/ClientApp/src/app/user/user-login/user-login.component.ts | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Timeline/ClientApp/src/app/user/user-login/user-login.component.ts b/Timeline/ClientApp/src/app/user/user-login/user-login.component.ts new file mode 100644 index 00000000..da642cb8 --- /dev/null +++ b/Timeline/ClientApp/src/app/user/user-login/user-login.component.ts @@ -0,0 +1,32 @@ +import { Component, Output, OnInit, EventEmitter, Input } from '@angular/core'; +import { FormGroup, FormControl } from '@angular/forms'; + +export type LoginMessage = 'nologin' | 'invalidlogin' | string; + +export class LoginEvent { + username: string; + password: string; +} + +@Component({ + selector: 'app-user-login', + templateUrl: './user-login.component.html', + styleUrls: ['./user-login.component.css'] +}) +export class UserLoginComponent { + + @Input() + message: LoginMessage; + + @Output() + login = new EventEmitter<LoginEvent>(); + + form = new FormGroup({ + username: new FormControl(''), + password: new FormControl('') + }); + + onLoginButtonClick() { + this.login.emit(this.form.value); + } +} |
