angularjs ui选择仅捕获键,而不是下拉式实时搜索中的值
我通过在框中键入来过滤下拉菜单,并将键捕获到我的模型中。它工作得很好!然而,问题是当我输入时,选择范围并没有缩小。问题在哪里 捕获密钥,但不再进行实时搜索强>angularjs ui选择仅捕获键,而不是下拉式实时搜索中的值,angularjs,angularjs-ng-repeat,ui-select,angular-ui-select,Angularjs,Angularjs Ng Repeat,Ui Select,Angular Ui Select,我通过在框中键入来过滤下拉菜单,并将键捕获到我的模型中。它工作得很好!然而,问题是当我输入时,选择范围并没有缩小。问题在哪里 捕获密钥,但不再进行实时搜索 <div class="form-group" > <label translate="data.continent"> my continents </label> <ui-select ng-model="myModel.continent" ng-chan
<div class="form-group" >
<label translate="data.continent">
my continents
</label>
<ui-select ng-model="myModel.continent" ng-change="continentSelect()" theme="bootstrap">
<ui-select-match placeholder="Select in the list...">
{{$select.selected.value}}
</ui-select-match>
<ui-select-choices repeat="r.key as r in data.continent.list track by $index | filter: {'key': $select.search}">
<div ng-bind-html="r.value | highlight: $select.search"></div>
</ui-select-choices>
</ui-select>
</div>
最终目标是:
最后一个目标是进行实时搜索,并将密钥传递给
ng change=“columentselect()”
将第二个代码替换为以下代码,只需添加.key
:
<ui-select-choices repeat="r.key as r in data.continent.list | filter: $select.search">
"list" : [
{"key" : "continent1", "value" : "Americas"},
{"key" : "continent2", "value" : "Europe"},
{"key" : "continent3", "value" : "Africa"}]
<ui-select-choices repeat="r.key as r in data.continent.list | filter: $select.search">