簡體   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