Arrays AngularUI引导式超前显示;“没有结果”;而不是下拉对象
我的AngularUI引导程序typeahead返回“未找到结果”,即使它应该读取一个对象数组 在uib typeahead中,我有Arrays AngularUI引导式超前显示;“没有结果”;而不是下拉对象,arrays,angularjs,twitter-bootstrap,ng-options,angular-ui-typeahead,Arrays,Angularjs,Twitter Bootstrap,Ng Options,Angular Ui Typeahead,我的AngularUI引导程序typeahead返回“未找到结果”,即使它应该读取一个对象数组 在uib typeahead中,我有uib typeahead=“getNumbers($viewValue)中的数字对应的数字” 在我的控制器里我有 $scope.getNumbers = function($viewValue) { ...stuff to retrieve numbers... return array } 其中console.log(数组)显示[对象,对象,对象…] 我只
uib typeahead=“getNumbers($viewValue)中的数字对应的数字”
在我的控制器里我有
$scope.getNumbers = function($viewValue) {
...stuff to retrieve numbers...
return array
}
其中console.log(数组)
显示[对象,对象,对象…]
我只是想展示一些我认为相关的代码。这就是问题所在吗?为什么下拉列表没有返回结果
<input
type="text"
class="form-control"
name="number"
ng-model="numberinfo.number"
uib-typeahead="number for number in getNumbers($viewValue)"
typeahead-template-url="/tpl.html"
typeahead-loading="Loadinglocations"
typeahead-on-select="numberSelect($item, 10)"
typeahead-wait-ms="3"
typeahead-min-length="3"
typeahead-no-results="noResults"
required>
<i ng-show="loadingLocations" class="glyphicon glyphicon-refresh">Loading...</i>
<div ng-show="noResults">
<i class="glyphicon glyphicon-remove"></i> No Results Found.
</div>
<script type="text/ng-template" id="/tpl.html">
<a>
<div>
<span style="display:block;" class="registration"
ng-bind-html="match.model.number | uibTypeaheadHighlight:query"></span>
</div>
</a>
</script>
加载。。。
没有发现任何结果。
您的控制器正在安慰对象,但您的uib打字机没有得到它,这可能是因为此参数
$scope.getNumbers = function($viewValue)
换成
$scope.getNumbers = function(viewValue)
您的控制器正在安慰该对象,但您的uib打字机没有得到它,这可能是因为此参数
$scope.getNumbers = function($viewValue)
换成
$scope.getNumbers = function(viewValue)
你能试着详细说明你的问题吗?创建一个这样我们就可以看到你的问题吗?你能展示一些控制器代码吗?你能试着详细说明你的问题吗?创建一个这样我们就可以看到你的问题吗?你能展示一些控制器代码吗?这没有改变任何事情。输出是一样的,“未找到结果”消息仍然显示。我想你必须做一次尝试才能理解你的ControlRR代码,我希望你能在那之后得到答案,这不会改变任何事情。输出是一样的,仍然显示“未找到结果”消息。我想你必须做一次尝试才能理解你的ControlRR代码,我希望你能在那之后得到答案