angularjs:只允许数字被输入到一个文本框 [英] angularjs: allows only numbers to be typed into a text box

查看:1163
本文介绍了angularjs:只允许数字被输入到一个文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在angularjs有任何可用的功能,只允许数字被输入到一个文本框

In angularjs is there any functionality available that allows only numbers to be typed into a text box like

推荐答案

此功能,你需要的。 <一href=\"http://docs.angularjs.org/api/ng.directive:input.number\">http://docs.angularjs.org/api/ng.directive:input.number

编辑:

您可以包装jQuery插件到指令。我创建了一个例子在这里: http://goo.gl/yYM2A

You can wrap the jquery plugin into directive. I created an example here: http://goo.gl/yYM2A

这篇关于angularjs:只允许数字被输入到一个文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆