member_webapp/@overflow/member/component/member-reset-password.component.ts
crusader 869fcf4e72 ing
2018-05-28 14:41:56 +09:00

37 lines
837 B
TypeScript

import { Component, OnInit, Output, EventEmitter } from '@angular/core';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
@Component({
selector: 'of-member-reset-password',
templateUrl: './member-reset-password.component.html',
})
export class MemberResetPasswordComponent implements OnInit {
@Output() resetPassword = new EventEmitter<string>();
resetPasswordForm: FormGroup;
formErrors = {
'email': ''
};
constructor(
private formBuilder: FormBuilder
) {
}
ngOnInit() {
this.resetPasswordForm = this.formBuilder.group({
'email': ['', [
Validators.required,
Validators.email
]
]
});
}
resetPasswordFormSubmit() {
const formValue = Object.assign({}, this.resetPasswordForm.value);
this.resetPassword.emit(formValue.email);
}
}