Last active
January 1, 2016 14:09
-
-
Save jharding/8156163 to your computer and use it in GitHub Desktop.
This file contains 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
<div class="example-exclaimation"> | |
<input class="typeahead" type="text" placeholder="try it out"> | |
</div> |
This file contains 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 anExcitedSource = function(query, cb) { | |
var results = $.map(['!', '!!', '!!!'], function(appendage) { | |
var datum = { theValue: query + appendage }; | |
return datum; | |
}); | |
cb(results); | |
}; | |
$('.example-exclaimation .typeahead').typeahead(null, { | |
displayKey: 'theValue', | |
source: anExcitedSource | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment