angular-typeaheadjs

Directive

This page is an adaptation of typeaheadjs examples page using AngularJS
to demonstrate the use of that component in an angular application using the
angular-typeaheadjs directive.

  1. Basics
  2. ·
  3. Remote-Prefetch
  4. ·

Basics

Using a dataset, with a function as source for computing suggestions.

Option selectOnAutocomplete=true is used to trigger select event on autocomplete with TAB key.

Selection: {{vm.itemonSelected}}

Remote - Prefetch

In this example the directive will create a Bloodhound engine for suggestions from prefetch and remote urls, with options passed in. (see the code)

Option clear=true is used to clear input after selection.

Try to type first the letter 'u' , you will see 5 (the limit specifies) items from prefetch data
Then if you type a 'n' you will see 3 items + 1 (last is from remote data)
Clear the input.
And type first the letter 'ut' , you will see 2 items from remote data

Item scrolled: {{vm.itemonCursorChanged}}
Selection: {{item}}
Fork me on GitHub