试图让ui Bootstrap uib-typeahead在搜索栏异步上工作。我得到了正确的数据响应,一个对象数组:
[ { username: 'yaboi' },
{ username: 'Gepeto' },
{ username: 'Zanbato' },
{ username: 'Colonel' },
{ username: 'Hipster' },
{ username: 'jacob' } ]
但它似乎没有过滤或使用uib-typeahead。虽然我可以得到一个响应,但我没有正确过滤,我很确定它已经贬值,因为它在控制台中发出一个警告,即成功不是一个功能。
我的循环有问题吗?
<input id="giftUser" ng-model="asyncSelected" class="form-control" type="text" autocomplete="off" placeholder="Search Users" uib-typeahead="username for username in getUsers($viewValue)" typeahead-loading="loadingUsers" typeahead-no-results="noResults">
<i ng-show="loadingUsers" class="glyphicon glyphicon-refresh"></i>
<div ng-show="noResults">
<i class="glyphicon glyphicon-remove"></i> No Results Found
</div>
我想我想通了 - 我使用的是旧版本的ui-bootstrap。 0.14之后的所有东西都需要uib,之前的一切都不需要。