Email validation is being fired as we keep typing in textbox. I want this validation to be fired when user focuses out of the textbox
Below is my code:
<input class="form-control" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,3}$"
name="Email" type="email" [(ngModel)]="model.Email" #Email="ngModel" required>
<div class="red" *ngIf="Email.errors && (Email.dirty || Email.touched)">
<div [hidden]="!Email.errors.pattern">
Please enter a valid email.
</div>
</div>
Please suggest me how can I achieve this. Thanks in advance.
Template driven forum
is used in my whole application . is reactive form module is only way of achieve this? – Mcalpin<div class="validation-message" *ngIf="form.controls['xxx'].isValid && isIdle">
Got this from the link mentioned above – Argumentation