I have tried to confirm the password with password value. I have done as per Async validator standard. But I am wondering it's not working and throw me the following error. Please tell anyone how to solve this error.
Expected validator to return Promise or Observable.
Here is my code.
Call Validators:
cPass: ['', Validators.compose([
Validators.required,
Validators.maxLength(32),
Validators.minLength(10)
]),
this.validPassword.bind(this)
]
Custom Validation funciton:
validPassword(control: AbstractControl) {
const isEqual = Observable.of(this.password == control.value);
return isEqual ? { valid : true } : null;
}