-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support local being a function #485
Comments
I would like the same feature. I have an Angular app. My data comes from a $q promise and I already make the $http request to the server because I need the data for other page elements too. I want to assign the datasources after I get the data later in the page lifecycle. Any help would be much appreciated. I think being able use function instead of a static array would help me too. |
+1 |
+1 Similar scenario. We're using Spine.js, so the data already exists as records in client-side models. I want Typeahead.js to fetch fresh data from the model each time it's opened. Currently, it seems the only option is to convert the model data into datums when Typeahead.js is instantiated... But then data becomes stale as soon as model records change... The old bootstrap typeahead could handle this with the |
|
Hopefully this feature can make it into v0.10 (#335) |
#370 only calls the function once right (in the constructor), I'd like to have it be called every time a search is performed. |
Oh ya didn't notice that, totally agree @ansman. |
+1 |
I'll look into this for v0.10.1. |
@ansman, you can now achieve this by defining your own source starting in v0.10.0. FYI, I'm still going to make the change that allows |
Coming from Bootstrap's typeahead I'm used to being able specify the source being a function that returns an array of items.
I would love to see this functionality in typeahead.js too.
The specification is quite simple, allow the
local
argument of a dataset to be a function that when called returns the same array that is today expected.The text was updated successfully, but these errors were encountered: