I am not seeing the ng-invalid class applied when I type into the field a string like abc. The ng-pattern works if i test it on the console...but not in angular.
<input type="number"
step=".05"
ng-pattern="/^\d{0,}\.{0,1}\d{0,}$/"
ng-model="someNumber">
@musically_ut's plnkr in the comments works for Firefox—i.e. the input element gets class ng-invalid for string abc—but not for Chrome.
For Chrome, it works for me if I add the required attribute, i.e.
<input type="number"
step=".05"
required
ng-pattern="/^\d{0,}\.{0,1}\d{0,}$/"
ng-model="someNumber">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With