0

I'm doing email validation with Angular out of box and works like must be.

<input class="form-control" type="email" placeholder="[email protected]"
               name="email" ng-model="user.email" required/>
        <div class="error-block" ng-if="form.$submitted && form.email.$invalid">
            <div ng-if="form.email.$error.required">Enter the Email Address</div>
            <div ng-if="form.email.$error.email">Invalid email address.</div>

The problem is that when the user insert a domain with more than 6 characters, Angular complain about it. For instance if I try to use the email [email protected], Angular set the email like Invalid.

But if I set the email [email protected], Angular validate the email without problems. Do I have some way to extend the regex to more than 6 characters or I need to use ng-pattern ?

Thanks guys

1 Answer 1

1

This behaviour was fixed in angular v1.2.10. You might either have to update to that version or use ng-patter with regular expression from this commit from angular repository.

Also, I'd advise you to look into this article about email regexp checking.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.