I work on angular 7 I make register form
when do validation to mail confirm on Reactive form .
function group take 2 argument only and when assign third argument for confirm email
function group not accepted and give error.
second argument for confirm password
third argument I need to assign for confirm mail but function group not accept
third argument
so what i do to make confirm email also
- constructor(){}
- UserMail = new FormControl('', [Validators.required, Validators.email,Validators.pattern('^[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,4}$') ,Validators.maxLength(100)]);
-
- ConfirmedEmail=new FormControl('',[Validators.required,Validators.email,Validators.maxLength(100)
- ])
-
- ngOnInit() {
- this.createFormValidations();
- }
- createFormValidations() {
- this.registerForm = this.formBuilder.group({
-
- UserMail: this.UserMail,
- ConfirmedEmail: this.ConfirmedEmail,
- UserPass: this.UserPass,
- ConfirmedPassword: this.ConfirmedPassword,
-
- },
- { validator: MustMatch('UserPass', 'ConfirmedPassword')}
- //here error function not accept mail confirm
- { validator: MustMatch('UserMail', 'ConfirmedEmail')}
-
- );
- }
- passwordMatchValidator(group: FormGroup) {
- return group.get('UserPass').value === group.get('ConfirmedPassword').value ? null : { misMatch: true };
- }
How to make confirm email on register form ?