https://github.com/eyolas/typeahead.js-jspm
Simple wrapper to make working with typeahead.js via jspm easier
https://github.com/eyolas/typeahead.js-jspm
Last synced: 9 months ago
JSON representation
Simple wrapper to make working with typeahead.js via jspm easier
- Host: GitHub
- URL: https://github.com/eyolas/typeahead.js-jspm
- Owner: eyolas
- License: wtfpl
- Created: 2015-09-17T09:34:34.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2018-04-18T15:03:23.000Z (about 8 years ago)
- Last Synced: 2025-08-18T17:33:11.254Z (10 months ago)
- Language: JavaScript
- Size: 43.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# typeahead.js-jspm
Make using [typeahead.js](http://twitter.github.io/typeahead.js/) with jspm a little easier.
The standard `typeahead.js` npm package doesn't expose Bloodhound, and loads it's jQuery plugin as soon as it's required.
This package is just a small wrapper that allows you to access Bloodhound and load the jQuery plugin explicitly.
# Usage
Bloodhound:
```javascript
import {Bloodhound} from "typeahead.js-jspm";
var engine = new Bloodhound({
local: ['dog', 'pig', 'moose'],
queryTokenizer: Bloodhound.tokenizers.whitespace,
datumTokenizer: Bloodhound.tokenizers.whitespace
});
```
For jQuery just `import` jquery, and then call `loadjQueryPlugin()`. typeahead.js will attach itself to the previously required jQuery.
```javascript
import $ from "jquery";
import typeahead from "typeahead.js-jspm";
typeahead.loadjQueryPlugin();
```