diff options
| author | 杨宇千 <crupest@outlook.com> | 2019-03-06 23:29:12 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-06 23:29:12 +0800 |
| commit | 4b37c96de2c7d3fe046a6f342d2da8ef03d3c807 (patch) | |
| tree | e5618cddfa6f637d7033ae5b52e6da825eb53c63 /Timeline/ClientApp/src/app/user/user-login/user-login.component.ts | |
| parent | aca753fba19a221f1aec65030ba4aec4bc34f576 (diff) | |
| parent | b5e01c4571061cbaf5915aa4c0f1b7126ef1ed18 (diff) | |
| download | timeline-4b37c96de2c7d3fe046a6f342d2da8ef03d3c807.tar.gz timeline-4b37c96de2c7d3fe046a6f342d2da8ef03d3c807.tar.bz2 timeline-4b37c96de2c7d3fe046a6f342d2da8ef03d3c807.zip | |
Merge pull request #3 from crupest/user
Develop user dialog.
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); + } +} |
