A directive to format phone number

后端 未结 7 1817
梦毁少年i
梦毁少年i 2021-01-02 00:33

I was wondering how to automatically format a number in an input field using an angularjs directive? When I type in an input field say 6042919283 I want it to be shown as 6

相关标签:
7条回答
  • 2021-01-02 01:27

    I've used the ui-mask directive in AngularUI to mask fields in the past with great success. The documentation isn't very helpful, but here's a simple example of how to make it work.

    Plunkr

    • Angular@1.4.1
    • Angular-UI-Utils@0.1.1
    0 讨论(0)
提交回复
热议问题