在ui-select中没有改变ng-model

Tek*_*uas 16 angularjs angular-ui ui-select2

我正在努力实现一些非常简单的事情:

<ui-select multiple ng-model="company.stack" theme="bootstrap">
    <ui-select-match>{$$item.name$}</ui-select-match>
    <ui-select-choices repeat="technology in technologies | filter: $select.search">
        <div ng-bind-html="technology.name | highlight: $select.search"></div>
    </ui-select-choices>
</ui-select>
Run Code Online (Sandbox Code Playgroud)

更改对象时,更改不会反映在model.stack模型中.我尝试将其更改为$ parent.company.stack,但它仍然无法正常工作.我错过了什么?我正在使用AngularJS v1.3.0-beta.17.

Aun*_*Aun 34

我也有类似的问题,与angular 1.3.14ui-select和多项选择ui-select指令绑定到一个数组.我无法将所选项目绑定到引用的数组中ng-model.我通过包装selectedItems到一个对象来实现它:

$scope.myObj = { selectedItems : []};
...

<ui-select ng-model="myObj.selectedItems" ...>
</ui-select>
Run Code Online (Sandbox Code Playgroud)

selectedItems直接上$scope并没有为我工作.


小智 -1

我遇到了类似的问题,似乎 Angular-ui-select#0.7 需要 Angular#1.2.* 此时才能正常工作。