ahmed elbarbary

ahmed elbarbary

  • NA
  • 1.6k
  • 278.4k

when do confirm mail function take 2 argument not 3 How solv

Jan 3 2020 7:32 AM
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
 
  1. constructor(){}  
  2. UserMail = new FormControl('', [Validators.required, Validators.email,Validators.pattern('^[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,4}$') ,Validators.maxLength(100)]);  
  3.   
  4. ConfirmedEmail=new FormControl('',[Validators.required,Validators.email,Validators.maxLength(100)  
  5. ])   
  6.   
  7. ngOnInit() {  
  8.   this.createFormValidations();  
  9.   }  
  10.   createFormValidations() {  
  11.     this.registerForm = this.formBuilder.group({  
  12.      
  13.       UserMail: this.UserMail,  
  14.       ConfirmedEmail: this.ConfirmedEmail,  
  15.       UserPass: this.UserPass,  
  16.       ConfirmedPassword: this.ConfirmedPassword,  
  17.         
  18.     },  
  19.       { validator: MustMatch('UserPass''ConfirmedPassword')}  
  20.       //here error function not accept mail confirm
  21. { validator: MustMatch('UserMail', 'ConfirmedEmail')}
  22.         
  23.     );  
  24.   }  
  25.   passwordMatchValidator(group: FormGroup) {  
  26.     return group.get('UserPass').value === group.get('ConfirmedPassword').value ? null : { misMatch: true };  
  27.   }  
 How to make confirm email on register form ?

Answers (1)