Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
angularjs ui选择仅捕获键,而不是下拉式实时搜索中的值_Angularjs_Angularjs Ng Repeat_Ui Select_Angular Ui Select - Fatal编程技术网

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">