简体   繁体   中英

ng-pattern is not working for input type Number in Inline html

when i was using this ng-pattern in external html file it was working fine ng-pattern is

ng-pattern="/^-?\\\\d{0,12}(\\\\.\\\\d{1,4})?/" now i have included this ng-pattern in inline html means js+html now it is not working input type is number so is there any reason behind it ,ng-pattern will not work for input type number in Case of inline html

Validation :Total of 16 digits including 4 digits after decimal point are allowed

part of html:

   <input type="number"  ng-model="ersProfileSectionData[field.code]"   
       ng- pattern="/^-?\\d{0,12}(\\.\\d{1,4})?/"/>'

答案是

ng- pattern="/^-?\\\\d{0,12}(\\\\.\\\\d{1,4})?/"/>'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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