How to email validation in angular 13 version. I have used a input field and submit button. If email validation failed then alert show.
<input type="email" [pattern]="emailPattern"
class="form-control adduser" placeholder="Email address"
[(ngModel)]="newEmailId">
<button type="button" class="commonnew-btn" (click)="addNewUser()">Add User</button>
Please find the ts file code
emailPattern = "^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$";
addNewUser(){
}
How to write in this method. Please give me advice. Not using form group or form tag and reactive form. Only this condition.