繁体   English   中英

Angular uib-typeahead无法正常工作

[英]Angular uib-typeahead is not working correctly

我已经研究并查看了其他解决方案,但我似乎无法让它继续工作。

我的主要问题是,uib-typeahead似乎根本不起作用,只需指向返回值或函数(我将在下面包含示例)。

我正在使用/继承Angular.UI.Bootstrap(v2.5.0)。

我的HTML调用(尝试使用异步和不使用)是:

 <input type="text" ng-model="selected" uib-typeahead="r.ResourceValueId as r.Value for r in ResourceValues | filter:$viewValue" class="form-control">



<input type="text" ng-model="asyncSelected" placeholder="Resources" uib-typeahead="item.ResourceValueId as item.Value for item in getResourceValuesSearch($viewValue)" 
typeahead-loading="loadingResources" typeahead-no-results="noResults" class="form-control">
<i ng-show="loadingResources" class="glyphicon glyphicon-refresh"></i>
<div ng-show="noResults">
<i class="glyphicon glyphicon-remove"></i> No Results Found</div>

这两个输入都没有出现下拉列表并且填充了ResourceValues(使用正常的“select”进行测试)。 对于异步,它根本不调用getResourceValuesSearch()函数。

更新:我同时包含并运行了ngSanitize和ngAnimate。 所以这个问题似乎与angular-ui-typeahead直接相关,因为其他一切看起来都很好。

写一个服务来调用Api并从中获得承诺。 在函数中使用服务并返回数据。

我想出了我遇到的问题。 我有ui.bootstrap的错误路径,虽然它没有返回任何错误...我仍然觉得奇怪。

无论哪种方式,我的问题是我的bundleConfig中ui.bootstrap的错误路径。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM