Roger Alsing Roger Alsing - 6 months ago 24
AngularJS Question

Is there an ng-model and input type email bug?

Is there something special going on with input type="email" and ng-model attribute?
If the input is email, then the model doesnt update.
If I change the input type to text, number or date it updates correctly.

Bug or some special magic email validation behavior that I dont understand?

Answer

It does some validation on then input, so you need to have entered a valid email address before it is bound to the model.

This is the regex that is used:

/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/

Basically you need to input an address that is at least a@b.co