Answer the question
In order to leave comments, you need to log in
How to change the validation of a field?
I do not use reactive forms - you need to validate the input field either asynchronously with the server call, or according to a given regex rule. You can write two directives, but how to substitute?
<input type="text" validateAsync>
<input type="text" validateNoAsync>
Answer the question
In order to leave comments, you need to log in
how to substitute?
<input *ngIf="sync" type="text" validateAsync>
<input *ngIf="!sync" type="text" validateNoAsync>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question