Reputation: 3937
How can I search names starting from first letter that user types, I want to know if user types B then names starting from B must be displayed rather than "SBI" word where B comes in second position. I want to search specific words which has first word match.
for example: if
list ={SBI, BSI, isb, bsisib, be happy, dont worry, hello}
Then If i type h character then I want all the words starting from 'h'. but when i tried it shows 'be happy' 'hello' result for h. I want hello only. Thank you
Upvotes: 1
Views: 517
Reputation: 16541
If you are using this on input field, then I suggest you to use an existing autocomplete solution for angularjs. There are many of them out there and are quite easy to use.
http://angular-ui.github.io/bootstrap/
Check the typeahead from angular ui bootstrap.
Or just google angularjs autocomplete, you will find tons of results.
Upvotes: 1
Reputation: 121
If you're list isn't extremely long try applying a regular expression on each item in ng-repeat filter.
Not sure if you want first word or first character in each word. Try the following plunker.
Upvotes: 1