I've got an Angular form with text inputs.
One input uses the standard Angular email validator.
I enable the form submit button when the form is valid.
I previously had the form controls validation triggered on blur however, I've been asked to change it back to change as the submit button was disabled / greyed out until they clicked out of the input (it was confusing).
So I've changed validation back to change but now the error messages appear too soon. When the user enters a single character a validation error is displayed which is annoying as they are entering data.
Any idea how I can validate on change but only display the error message after a delay or when they focus out of the input?
I'm sure this is a common problem, but the logic to display the message (below) seems to be used in all examples.
<inm-validation-message
class="validation-container"
*ngIf="control && control.invalid && (control.dirty || control.touched)"
[control]="control">
</inm-validation-message>
control.dirty && control.touchedif you want to keep both.