Empty form template not working

I am setting up typeahead like this:

       $this.typeahead({ 
            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.

+3


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

+1


source







All Articles