Answer the question
In order to leave comments, you need to log in
How to sort in autocomplete?
Here is an example:
Example
As far as I understand, when the page is loaded, all the data in customTemplate.html is given at once, so sorting in the database does not work.
Sorting should be here:
typeahead="c as c.country for c in countries | filter:$viewValue | orderBy:????? |limitTo:10"
Answer the question
In order to leave comments, you need to log in
I strongly advise against using filters for collections - they will work for every sneeze (every $digest of this scope). It is better to do it all the same where you transfer a new collection to the scope.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question