Form Validation - Email Validation not working as expected in AngularJs

后端 未结 6 723
北荒
北荒 2020-12-25 12:35

I am using Angular for form validation.

Here is what I use - plunker-edit I have taken this code from Angularjs documentation - Binding to form and control state Hav

6条回答
  •  一向
    一向 (楼主)
    2020-12-25 13:25

    Angular 6

    I generally don't want to allow $$$@$$$ format and always expect a TLD (like .com, .net, .org, etc).

    In addition to angular email validator I add my regex pattern to make it work.

     
    

    pattern="^\S*[@]\S*[.]\S*$" will make sure that there is a @ and a . followed by a string. This will be an addition to Angular's email validation.

提交回复
热议问题