Validate <input type=“number” /> with AngularJS and Pattern/RegEx

前端 未结 4 1998
野趣味
野趣味 2021-01-12 11:36

I have a input of type number, and I want to make sure it only accepts a number. I can do this fine on the Server side, but with AngularJS I can not get it to work.

4条回答
  •  醉梦人生
    2021-01-12 12:03

    Try defining your regex as a scope variable In the controller, it worked for me.

提交回复
热议问题