I don’t know how to compare the fields with passwords for the function of the validator, below is a function that validates the fields with passwords, but this validator can only hang on one field and how to do the same function for two
this.form = new FormGroup({ 'name': new FormControl(null, [Validators.required]), 'email': new FormControl(null, [Validators.required, Validators.email], this.forbiddenEmails.bind(this)), 'pass': new FormControl(null, [Validators.required, Validators.minLength(6)]), 'conf_pass': new FormControl(null, [Validators.required, Validators.minLength(6)], this.confirm_pass.bind(this)) }) confirm_pass(control: FormControl): Promise<any>{ const val = this.form.value; return new Promise((resolve, reject) => { if (control.value !== val.pass){ resolve({confirm_pass: true}); }else { resolve(null); } }) }