简体   繁体   English

AngularJS ng模式-1或2个数字

[英]AngularJS ng-pattern - 1 or 2 numbers

In the code below I need to get the ng-pattern to receive 1 or 2 numbers, the format being in minutes, that is, minimum 0 or 00 and maximum 59. 在下面的代码中,我需要获取ng-pattern以接收1或2个数字,格式以分钟为单位,即,最小0或00,最大59。

<input type="text" step="any" value="" ng-model="job.valueIntervalo" 
       min="0" max="60" ng-pattern="/^([0-9]{1}[0-9]{1}$/">

try this, 尝试这个,

<input type="text" step="any" value="" ng-model="job.valueIntervalo"
       min="0" max="60" ng-pattern="/^[0-5]{1}[0-9]{1}$/">

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

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