0

I am trying to implement typeahead by searching through an array of objects. How do i do so? I only know how to search through an array but not an array of object

Array of object

enter image description here

HTML:

   <input type="text" class="searchFeature" ng-keyup="$event.keyCode == 13 && 
   searchFunction()" ng-model="selected" uib-typeahead="value for value in 
   allTheme | filter:$viewValue | limitTo:7" placeholder="Start your search here.">

The result i am getting :

enter image description here

PS: Is it possible to get just the "THEMENAME" and "Category" object and filter it in my typeahead search?

Aleksey Solovey
  • 4,153
  • 3
  • 15
  • 34
HangulSR
  • 259
  • 2
  • 10
  • I don't see how you can show both parameters you are searching for, but with one, you need to select its key: `value.THEMENAME for value in allTheme`. If you want to search by some specific key, write a custom filter for that – Aleksey Solovey Oct 26 '18 at 08:34

1 Answers1

0

try

uib-typeahead="value.THEMENAME for value in allTheme | filter:$viewValue | limitTo:7"

Venkatesh K
  • 721
  • 1
  • 8
  • 9