Angular2 email validation

前端 未结 9 1887
既然无缘
既然无缘 2020-12-13 04:20

I am new in learning Angular2, and I want to make a validation form that verifies emails after a RegEx pattern.

My code looks something like this but I don\'t have a

9条回答
  •  误落风尘
    2020-12-13 04:47

    Angular 4 has a built-in "email" validation tag that can be added within the input. E.g.:

    
    

    This will be valid for a series of numbers and letters then an @ then another series of letters. It will not account for the dot after the @ -- for that you can use the "pattern" tag within the input and your standard regex.

提交回复
热议问题