I have an ajax route which respond a json array with sites which gets it from a txt file. In my twig template Im using typeahead function to do an ajax call like:
var sites= new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.whitespace,
queryTokenizer: Bloodhound.tokenizers.whitespace,
remote: '{{'ajax_fun'}}'
});
$('#bloodhound .typeahead').typeahead({
name: 'sites',
source: sites
});
The filtering on input field does not work even thought i get the array with the sites.