AngularJs email validation error -
this question has answer here:
i have 2 email address
example@gmail.com
and
example@somevalue
both email address valid when use angularjs validation
<input type="email" ng-model="application.email_id" placeholder="enter email">
i need make example@somevalue mail address false if address wrong.
this tutorial part of angularjs email validation: there validation true when inputing above email address.
use ng-pattern="" custom pattern validate email. in controller:
$scope.pattern = /.+\@.+\..+/;
in html:
<input type="email" name="input" ng-model="email.text" ng-pattern="pattern" required>
see plunker (the example angular documentation extended ng-pattern)
Comments
Post a Comment