Angular-ReactiveForms
Angular-ReactiveForms copied to clipboard
Generic validator with AsyncValidator
I'm just opening a little discussion on this subject.
I wonder if this part of the code will work with AsyncValidators ?
merge(this.productForm.valueChanges, ...controlBlurs).pipe( debounceTime(800) ).subscribe(value => { this.displayMessage = this.genericValidator.processMessages(this.productForm); });
My guess is this.genericValidator.processMessages(this.productForm)
will end before AsyncValidators and so async errors won't be displayed. Maybe the errors will be displayed the next time this.genericValidator.processMessages(this.productForm)
run again.