This question is related to another question . I asked.
I managed to get AngularUI Typeahead to work. However, my orderBy filter does not seem to do anything.
This flag arranges everything correctly (distance is a custom function):
<select ng-model="fromStation"
ng-options="item.name for item in stations.station | orderBy:distance">
But this type:
<input type="text" ng-model="fromStation"
typeahead="item as item.name for item in stations.station
| filter:$viewValue | limitTo:8 | orderBy:distance">
doesn't change the order at all (i.e. it is still sorted alphabetically). What I would like to achieve is that when the user enters the first letter a - in this case, the railway station, the first station closest to it containing this letter will be the first. Is it possible to do this work or is this function not available (yet)?