带有浮点验证的 AngularJS xeditable 数字字段 [英] AngularJS xeditable number field with float validation

查看:20
本文介绍了带有浮点验证的 AngularJS xeditable 数字字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 AngularJS 的问题.如果我使用 xeditable

I have issue with AngularJS. If I use xeditable

<a editable-number="some.object"....

我无法输入浮点数...那么,如何添加浮点数并在视图中进行浮点验证?

I can't input float numbers... So, how can I add float numbers and have float validation in view ?

推荐答案

需要设置step属性标记为任何".

You need to set the step attribute of the <input type="number"> tag to "any".

解决此问题的一种方法是利用 xeditable 的 e-* 语法,其中您指定的任何以 e- 开头的属性都将传递到底层输入标签:

One way to solve this is to take advantage of xeditable's e-* syntax, where any attribute you specify that begins with e- will be passed through to the underlying input tag:

<a editable-number="some.object" e-step="any">{{some.object || 'Enter Number'}}</a>

这篇关于带有浮点验证的 AngularJS xeditable 数字字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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