Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dhaulagiri/ember-typeahead
https://github.com/dhaulagiri/ember-typeahead
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/dhaulagiri/ember-typeahead
- Owner: Dhaulagiri
- License: mit
- Created: 2015-09-10T18:47:46.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-11-22T17:55:19.000Z (almost 7 years ago)
- Last Synced: 2024-09-02T10:47:56.004Z (about 1 month ago)
- Language: JavaScript
- Size: 110 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Ember-typeahead
`ember-typeahead` is an ember-cli addon that wraps up the [typeahead.js](https://twitter.github.io/typeahead.js/) and [Tokenfield for Boostrap](http://sliptree.github.io/bootstrap-tokenfield/) plugins and exposes them through a single ember component.
## Usage
### Typeahead
The default usage of the `type-ahead` component gives the consumer a typeahead.js search:
```handlebars
{{type-ahead
id="typeahead-id"
content=contentArray
displayKey="name"
valueToken="name"
placeholder="Search by name"
class="form-control"
selectOnEnter=true
suggestionTemplate=suggestionTemplate
emptyTemplate=emptyTemplate
limit=numberofresultstodisplay
onSelectAction="ActionToRunOnSelect"}}
```### Tokenized
Switching the typeahead from a typeahead.js function to a Tokenfield for Bootstrap function is as simple as passing `tokenized=true` into the component as well as setting the `value` property to a comma-delimited string of values that will be bound as the tokenized list of items selected in the input.
```handlebars
{{type-ahead
id="typeahead-id"
tokenized=true
value=selectedApps
content=contentArray
displayKey="name"
valueToken="name"
placeholder="Search by name"
class="form-control"
suggestionTemplate=suggestionTemplate
emptyTemplate=emptyTemplate}}
```## Installation
* `git clone https://github.com/dhaulagiri/ember-typeahead` this repository
* `cd ember-typeahead`
* `yarn`## Running
* `ember serve`
* Visit your app at [http://localhost:4200](http://localhost:4200).## Further Reading / Useful Links
* The typeahead.js component is based heavily on the [ember-cli-twitter-typeahead](https://github.com/Dhaulagiri/ember-cli-twitter-typeahead) addon
* [Tokenfield for Boostrap](http://sliptree.github.io/bootstrap-tokenfield/)
* [typeahead.js](https://twitter.github.io/typeahead.js/)
* `npm test` (Runs `ember try:each` to test your addon against multiple Ember versions)
* `ember test`
* `ember test --server`## Building
* `ember build`
For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).