I'm using md-autocomplete directive as a address for zip code lookup. I want to limit what the user type in the control to five digit zip code only. It has to be numbers and limited to 5 numbers.
How can I achieve this in md-autocomplete?
I'm using md-autocomplete directive as a address for zip code lookup. I want to limit what the user type in the control to five digit zip code only. It has to be numbers and limited to 5 numbers.
How can I achieve this in md-autocomplete?
you can achieve this with a filter: http://jsfiddle.net/uhmgp23h/2/
js
This filter will restrict the field to numbers only and also limit it to 5 characters. This filter will work with any number of chars, just change the
5
to whatever you want in this line$filter('numberFixedLen')(number,5);