Validate phone number using angular js

前端 未结 9 541
情歌与酒
情歌与酒 2020-12-03 00:13

Want to set phone-number to 10 digits, How can I do this using Angular js.

This is what I have tried:



        
9条回答
  •  我在风中等你
    2020-12-03 00:47

    Check this answer

    Basically you can create a regex to fulfil your needs and then assign that pattern to your input field.

    Or for a more direct approach:

    
    

    More info @ angular docs here and here (built-in validators)

提交回复
热议问题