正在尝试让ui的Bootstrap uib-typeahead在搜索栏上异步工作。我得到了正确的数据响应,一个对象数组:
[ { username: 'yaboi' },
{ username: 'Gepeto' },
{ username: 'Zanbato' },
{ username: 'Colonel' },
{ username: 'Hipster' },
{ username: 'jacob' } ]但它似乎不能过滤或与uib-typeahead一起工作。只使用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>发布于 2018-03-08 08:17:10
我想我弄明白了--我用的是较老版本的ui-bootstrap。0.14之后的所有内容都需要uib,而0.14之前的所有内容则不需要。
https://stackoverflow.com/questions/49163240
复制相似问题