我的AngularUI引导程序typeahead返回“No Results Found”,即使它应该读取对象数组。AngularUI Bootstrap typeahead显示“No Results”而不是下拉对象
在UIB-预输入我uib-typeahead="number for number in getNumbers($viewValue)"
,并在我的控制器我有
$scope.getNumbers = function($viewValue) {
...stuff to retrieve numbers...
return array
}
其中console.log(array)
显示[对象,对象,对象...]
我只是想以显示我认为相关的代码位。这是问题所在吗?为什么下拉菜单返回未找到结果?
<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>
你可以尝试阐述的你的问题创建一个[Plunker](http://plnkr.co),以便我们可以看到你有问题? – luixaviles
你能显示一些控制器代码吗? – Wcan