I have the issue with <md-autocomplete>
component which is shown in this demo:
<md-autocomplete ng-pattern="...">
does not work. I would expect that if some text is entered into Tax
field (like zzz
) the field is be marked as red as only numbers [1..99] are accepted by regex ng-pattern="/^[1-9]\d?$/"
. Actually required
works fine: when the field is empty, it is triggered as invalid.
That seems to have been a bug with Angular Material. It was apparently fixed in 1.1.4:
ng-pattern for md-autocomplete #9755
Here's a working demo. All I did was update the two angular-material libraries.
https://cdnjs.cloudflare.com/ajax/libs/angular-material/1.1.4/angular-material.min.js
https://cdnjs.cloudflare.com/ajax/libs/angular-material/1.1.4/angular-material.min.css
The issue with ng-pattern got fixed in version 1.1.14. I have updated the Demo and added latest angularjs-material.js
I have not changed ng-pattern, it remains same.
ng-pattern="/^[1-9]/"
Now the field will change to red if other than number is entered.
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