Bootstrap typeahead for donejs
npm install donejs-typeahead
1. npm install donejs-typeahead --save
1. import it within your stache file, for instance index.stache
1. insert it using the options you need
```
remote-path="/developers"
suggestion-template='[[name]] / [[github]]'
display-value="name"
search-value="github"
remote-host="donejs-typeahead-backend-zqqnzgjjre.now.sh"
remote-protocol="https://"
remote-port="443"
{(selected-element-value)}="global-variable"/>debug=true
1. You'll need an API server (@todo: provide a step by step guide for this, probably using feathersjs)
1. You can use to make things easier (actually setting debug to any value will do it)your-variable
1. Set the correct name for in order to create a two way binding with your viewmodel. If you want to set the binding using an object use {(selected-element-object)}="your-variable"
Remember to start the server using donejs develop
http://localhost:8080/src/donejs-typeahead.html
- Typeahead project: http://twitter.github.io/typeahead.js
- Typeahead project samples: http://twitter.github.io/typeahead.js/examples/
With StealJS, you can import this module directly in a template that is autorendered:
`js`
import plugin from 'donejs-typeahead';
Use require to load donejs-typeahead and everything elsedonejs-typeahead
needed to create a template that uses :
`js`
var plugin = require("donejs-typeahead");
Configure the can and jquery paths and the donejs-typeahead package:
`html`
Load the global version of the plugin:
`html`
To make a build of the distributables into dist/ in the cloned repository run
``
npm install
node build
Tests can run in the browser by opening a webserver and visiting the test.html page.
Automated tests that run the tests from the command line in Firefox can be run with
```
npm test