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

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -