Typeahead: missing source error

I get this error in the console every time I try to run the following code

$('#autcomplete_search').typeahead({ highlight: true }, { name: 'apple_game', remote: "/search/autocomplete?keyword=make" }); 
+6
source share
1 answer

Typeahead: Missed Error Missing Source

If you selected remote , you need to specify the engine . Here is an example from the docs

 var bestPictures = new Bloodhound({ datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'), queryTokenizer: Bloodhound.tokenizers.whitespace, prefetch: '../data/films/post_1960.json', remote: '../data/films/queries/%QUERY.json' }); bestPictures.initialize(); $('#remote .typeahead').typeahead(null, { name: 'best-pictures', displayKey: 'value', source: bestPictures.ttAdapter() }); 

in this example var bestPictures is your engine

irrigation documentation

+7
source

All Articles