-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Typeahead show loading #192
Comments
I found a better way of doing this, but it required a small change to the typeahead plugin. I will make a pull request when I am at home and have a bit of time. |
I would add a variable in the directive scope when the typeahead value is an unresolved promise, and then add a loading spinner to the template based on that scope variable. |
@ajoslin That is basically what I did. I added scope.loading = true and then set scope.loading = false when the promise was resolved in getMatchesAsync(). I also had to setup the scope on the directive typeaheadPopup so that I could use the parent scope's loading. |
@kloy Pull request for this would be awesome |
@pkozlowski-opensource I am having problems getting the angular-ui tests to run, and don't have time at the moment to get it working. Here is a working example of the code http://plnkr.co/edit/pbHtXnzGc7biWxuawAYD Here is the commit on my fork kloy@827f263 |
Fixed via b58c9c8 |
@pkozlowski-opensource I am probably just missing how to do this, but from what I can tell you can not detect if a promise is still loading from within in the directive?
The only way I have come up with doing this thus far is to add an attribute to the input like
typeahead-loading="value"
and modify typeaheadPopup template and scope to see the value.Is there a better way of doing this?
The text was updated successfully, but these errors were encountered: