0

I'm trying to limit the amount of results Angular Bootstrap Typeahead returns when doing Async calls but it's not working at all.

<input type="text" ng-model="asyncSelected" 
placeholder="Locations loaded via $http" typeahead="address for address in getLocation($viewValue) | limitTo:3" 
typeahead-loading="loadingLocations" class="form-control">

I added limitTo:3 to test it out in the Plunker example but it doesn't work, is there a way to do this or is this a bug in Typeahead?

plnkr

Rajeshwar
  • 2,290
  • 4
  • 31
  • 41
ngplayground
  • 20,365
  • 36
  • 94
  • 173

1 Answers1

0

I think typeahead filters aren't working with async calls. See this thread : https://github.com/angular-ui/bootstrap/issues/993

It may be not as elegant, but you can filter results in the fetching function.

Komo
  • 2,043
  • 1
  • 22
  • 35