Reputation: 18719
I have an issue with Validators.pattern
with a following regex:
/^[_a-z0-9]+([_a-z0-9]+)*@[a-z0-9-]+([a-z0-9-]+)*([a-z]{2,4})$/
which should verify email address. You can check out the plnkr. If you delete Validators.pattern(..)
, the form will work.
Any ideas?
Upvotes: 0
Views: 1214
Reputation: 658205
Probably because pattern
wasn't yet avaliable in beta.37 which you're using in your Plunker.
ORIGINAL EXCEPTION: TypeError: angular2_1.Validators.pattern is not a function
Working Plunker
Upvotes: 1
Reputation: 96
Why not use the built-in email validation:
<input name="myInput" ng-model="myInput" type="email">
See http://www.w3schools.com/angular/angular_validation.asp
Upvotes: 1