1validateEmail(email) {
2 const regularExpression = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
3 return regularExpression.test(String(email).toLowerCase());
4}
1
2<input type="email" name="email" ngModel email>
3<input type="email" name="email" ngModel email="true">
4<input type="email" name="email" ngModel [email]="true">
5