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