简体   繁体   English

如何在angularJS中验证日期和数字

[英]How to validate Date and Number in angularJS

How can validate date formate in AngularJS. 如何在AngularJS中验证日期格式。

How can i validate number upto two digit decimal point and allowing users to add thousand separate. 我如何才能验证数字最多两位小数点并允许用户分别添加千位。

If you use <input type=date /> or <input type=number /> and the browser is a modern browser than AngularJS will do the validation using the browser. 如果您使用<input type=date /><input type=number />并且浏览器是现代浏览器,则AngularJS将使用该浏览器进行验证。 If you need to support older browsers that don't support those input types, then look at using ng-pattern directive to supply a regex. 如果您需要支持不支持这些输入类型的旧版浏览器,那么可以考虑使用ng-pattern指令来提供正则表达式。

https://docs.angularjs.org/api/ng/directive/input# ! https://docs.angularjs.org/api/ng/directive/input#

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM