Created
October 17, 2015 14:53
-
-
Save johnmmoss/6c448fa0a3c4ef11f534 to your computer and use it in GitHub Desktop.
Typeahead and Bloodhound engine example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bloodhound = new Bloodhound({ | |
datumTokenizer: Bloodhound.tokenizers.whitespace, | |
queryTokenizer: Bloodhound.tokenizers.whitespace, | |
remote: | |
{ | |
url: baseUrl + '?q=%QUERY', | |
wildcard: '%QUERY', | |
} | |
}); | |
bloodhound.initialize(); | |
$('#bloodhound .typeahead').typeahead({ | |
hint: true, | |
highlight: true, | |
}, | |
{ | |
name: 'states2', | |
displaykey: 'state', | |
source: bloodhound.ttAdapter() | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment