public registerForm!: FormGroup;
constructor(
private _fb: FormBuilder
) { }
ngOnInit(): void {
const self = this;
self._createRegisterForm();
}
private _createRegisterForm(): void {
const self = this;
self.registerForm = self._fb.group({
email: ['', [Validators.required, Validators.email]]
});
// To Appended field
self.registerForm = self._fb.group({
...self.registerForm.controls,
password: ['', Validators.required],
password_confirmation: ['', Validators.required],
}, {
validator: MustMatch('password', 'password_confirmation')
})
}
constructor(
private _fb: FormBuilder
) { }
ngOnInit(): void {
const self = this;
self._createRegisterForm();
}
private _createRegisterForm(): void {
const self = this;
self.registerForm = self._fb.group({
email: ['', [Validators.required, Validators.email]]
});
// To Appended field
self.registerForm = self._fb.group({
...self.registerForm.controls,
password: ['', Validators.required],
password_confirmation: ['', Validators.required],
}, {
validator: MustMatch('password', 'password_confirmation')
})
}
0 comments:
Post a Comment