Skip to content

Instantly share code, notes, and snippets.

@jharding
Last active January 1, 2016 14:09
Show Gist options
  • Save jharding/8156163 to your computer and use it in GitHub Desktop.
Save jharding/8156163 to your computer and use it in GitHub Desktop.
<div class="example-exclaimation">
<input class="typeahead" type="text" placeholder="try it out">
</div>
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