How do I restrict an input to only accept numbers?

前端 未结 17 1232
感情败类
感情败类 2020-12-07 09:28

I am using ngChange in AngularJS to trigger a custom function that will remove any letters the user adds to the input.



        
17条回答
  •  北海茫月
    2020-12-07 10:19

    I know this is old, but I've created a directive for this purpose in case anyone is looking for an easy solution. Very simple to use.

    You can check it out here.

提交回复
热议问题