K
K
Konstantin2020-04-20 11:05:55
Angular
Konstantin, 2020-04-20 11:05:55

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

1 answer(s)
A
Anton Shvets, 2020-04-20
@Junart1

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 question

Ask a Question

731 491 924 answers to any question