blob: 072f04afa66eaf32f570f9ba4802ff7ec140590e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
import { Component, Output, OnInit, EventEmitter } from '@angular/core';
import { FormGroup, FormControl } from '@angular/forms';
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 {
@Output()
login = new EventEmitter<LoginEvent>();
form = new FormGroup({
username: new FormControl(''),
password: new FormControl('')
});
onLoginButtonClick() {
this.login.emit(this.form.value);
}
}
|