Open musketyr opened 10 years ago
another - maybe simpler to implement - option to implement this would be register update handler for the source promise as well so you can supply the intermediate results on the fly.
@musketyr actually this work as you expect already, at least I can't think of anything that would prevent thigs working like this. What did you try? What problems did you face? Please send a minimal plunk with a live reproduce scenario, otherwise it is impossible to suggest solutions (see https://github.com/angular-ui/bootstrap/blob/master/CONTRIBUTING.md#you-think-youve-found-a-bug)
I've created plunk for you. in this example I would like to see the Paris, France
immediately before the getLocation()
function finishes fetching the real results.
@musketyr If I understand you correctly, you want the typeahead to have a default value before you start initiating the async call? Like this: http://plnkr.co/edit/4Aq2DUIQ4yclWZeIcWB8 ?
Seems like a support question rather than a bug report to me.
no, this is not the issue at all. please, reopen the issue.
let's try it again:
I have a typeahead (let's say for location as in that plunk. and I have some preferred/predefined select options (not preselected/default value as you suggested) and as calls to getLocation()
function can take a while I would like to show these select options before the the function completes. the general case is that if I have paginated results in that async call and want to show the select options from the first page of results as soon as I fetch them and don't want to wait until I finish reading all pages I should be able to post the provisional results to promise.notify
and when I fetch all pages I can finally call promise.resolve
The implementation shouldn't be that difficult. There only thing which is basically needed is to put the third callback to this call https://github.com/angular-ui/bootstrap/blob/master/src/typeahead/typeahead.js#L128 but I'm not able to send a pull request as I'm not sure how to write a unit test for it.
This is reasonable - I will see if we can get this implemented sometime soon.
Great, thank you!
On Sat, Aug 1, 2015 at 8:57 PM Wesley Cho notifications@github.com wrote:
This is reasonable - I will see if we can get this implemented sometime soon.
— Reply to this email directly or view it on GitHub https://github.com/angular-ui/bootstrap/issues/2388#issuecomment-126945118 .
Adding another example to the table.
I find myself in a situation where the entries of my popup should be fetched from different remote services, and right now I have a function in charge of firing the requests, wait for the responses, and return the aggregated set of options to the engine.
The problem with this approach is that the popup will be shown to the user only when all the options have been collected locally. On the other hand, if the entries of the popup were bound to a user provided collection, retrieved options could be pushed into this collection as soon as possible.
This seems to be related (I did not try the proposed changes though): https://github.com/angular-ui/bootstrap/issues/2654
While still related, that issue does not contain a workaround to bind options to a collection; this does: https://github.com/angular-ui/bootstrap/issues/3011
Hi im facing issue in typehead which is inside grid cell template and its not showing dropdown in IE11 but its working fine in Chrome browser can any one help me in this issue
@madhansekar, Hi there! Two things:
So this still isn't done.
I would like to build an omnisearch box similar to one GitHub has. For that case it would be great if the typeahead would watch the changes in the array returned from the source. In that case I can preload some results (e.g. search actions) statically and the rest add dynamically when the http request to the backend is finished.