I tried to confirm the password with a password. I did this according to Async authentication standard. But I'm curious that this does not work and throws me the following error. Please let everyone know how to resolve this error.
The expected validator to return a promise or observation.
Here is my code.
Call Validators:
cPass: ['', Validators.compose([ Validators.required, Validators.maxLength(32), Validators.minLength(10) ]), this.validPassword.bind(this) ]
Custom validation function:
validPassword(control: AbstractControl) { const isEqual = Observable.of(this.password == control.value); return isEqual ? { valid : true } : null; }
source share