In the option table it says the ajax option (whether object or string) is null by default. This isn't true, because in the $.fn.typeahead.defaults the ajax option is a predefined object. So unless you specifically tell your instance to have an ajax option of null, the ajax option will not be null. I came across this when the sorter method didn't seem to work. It turns out the sorting is skipped when the ajax option is set. I only used the source option, but it didn't sort until I specifically set the ajax option to null.
So either have the default value actually be null or edit the options table in the documentation to reflect the predefined ajax object.
Created a pull request for this issue. I added an extra check to see if the url property of the ajax option is set: pull request #40
Also added support for sorting objects.
In the option table it says the ajax option (whether object or string) is
null
by default. This isn't true, because in the$.fn.typeahead.defaults
the ajax option is a predefined object. So unless you specifically tell your instance to have an ajax option of null, the ajax option will not be null. I came across this when the sorter method didn't seem to work. It turns out the sorting is skipped when the ajax option is set. I only used the source option, but it didn't sort until I specifically set the ajax option to null.So either have the default value actually be null or edit the options table in the documentation to reflect the predefined ajax object.