[typeahead] isLoading and noResults available in popup scope
Outside directive controller you don't have access to position() values and inside directive you don't have access to isOpen and isNoResults. So, to have a same styled results showing No matches or Loading..., you have to re-implement position() or add fake values if no matches or during loading which could be a little bit ugly with something which is already calculated inside scope.
We can change plugin code to something like:
isLoadingSetter(originalScope, true);
// to
isLoadingSetter(originalScope, scope.isLoading = true);
And then pass this values to popup template. This feature allows to create custom templates like:
<ul ng-show="isOpen() || isLoading || isNoResults" ...>
<li ng-repeat="match in matches track by $index" ....>
<div uib-typeahead-match ...></div>
</li>
<li ng-if="isLoading">Is loading</li>
<li ng-if="isNoResults">No results</li>
</ul>
I can make a PR doing this but I wanted to ask you before. What do you think?
I'm ok with this if done correctly, but you cannot use ES6 syntax like you've done as we do not yet support that in our builds. @wesleycho, thoughts?
A potential PR will need associated tests and may need doc updates as well.
Hi All, I want to use Typeahead functionality to get ajax call on time interval but I do not want to show list of items's pop up. How can I prevent to show that popup?
Please don't spam questions irrelevant to the original issue in that issue.
So as for this feature, I'm ok with it, but it needs to reset isLoading to false after it finishes the load.
PRs welcome.
OK guys, thank you. I'll PR ASAP.
Hi.
There is any way to pass isLoading and noResults in a popup template scope now ? Or do you still need a PR ?