Skip to content

Latest commit

 

History

History
35 lines (24 loc) · 824 Bytes

README.md

File metadata and controls

35 lines (24 loc) · 824 Bytes

typeahead.demo

This demo shows how to use angular.js typeahead directive from npm. Interactive version is available here.

Steps to make this work

Install directive from npm:

npm i typeahead.an

Require npm direcives, before bootstraping your main angular app:

require('typeahead.an');

var ngApp = angular.module('MyModule', []);
require('an').flush(ngApp);

// Finally bootstrap it:
angular.bootstrap(document, [ngApp.name]);

Now your directive is ready to be used inside html:

<input type="text"
      ng-model="addressModel"
      typeahead="address for address in getLocation($viewValue) | filter:$viewValue"
      typeahead-loading="loadingLocations">

Please read more here: anvaka/an