Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to restrict input field length (max length) using <md-autocomplete>

I would like to achieve the behavior to restrict/limit users entr to only 10 numbers for ex:

Anyone know how to do this?

I do see that they have an attribute md-input-maxlength, but i am not able to get it work, or find an example.

Appreciate your inputs.

like image 806
user2919905 Avatar asked Oct 27 '25 03:10

user2919905


1 Answers

Extend from John Smith's answer, you can try

md-search-text-change="searchText = searchText.substring(0,10)"
like image 108
pcchan Avatar answered Oct 30 '25 14:10

pcchan