1
我正在使用此库:https://github.com/angular-ui/ui-select 我可以看到演示程序正常工作,但是当我尝试将它适用于自己的目的时,它不起作用。实际控制本身似乎没问题,但我指定的ng-model
不更新。Select2不在角度工作
这里是一个plunkr这说明我的意思:http://plnkr.co/edit/xEtoR49Du9CdrNNoDWAa?p=preview
如果删除6M(例如),数组selectedServices
图所示它不更新。
<ui-select multiple ng-model="selectedServices">
<ui-select-match placeholder="Services...">{{ $item }}</ui-select-match>
<ui-select-choices repeat="service in services | filter: $select.search">
{{ service }}
</ui-select-choices>
</ui-select>
{{ selectedServices }}
和:
app.controller('DemoCtrl', function($scope, $http, $timeout) {
$scope.selectedServices = ['1M', '6M', '12M'];
$scope.services = ['1M', '6M', '12M'];
});
谢谢你,完美的工作。 – b85411