Empty form template not working

I am setting up typeahead like this:

            prefetch: $this.data('url-prefetch'), 
            templates: { 
                empty: 'No matching files found' 


Prefetching works fine, but an empty template is not displayed when there is no match.


source to share

1 answer

Fundamental changes have been made to Typeahead.js v0.10.x. After examining your code, it looks like you are targeting Typeahead v0.9.x, so make sure you download this older version or things won't work.

I suggest you update your code to support v0.10.x, here is the migration guide: https://github.com/twitter/typeahead.js/blob/master/doc/migration/0.10.0.md



All Articles