我是 AngularJS 的新手,因此对如何将复选框或多选下拉列表绑定到单独的列表感到困惑。
<body ng-controller="FooListCtrl">
<span ng-repeat="foolist in foos">
<select ng-model="selected" ng-options="foo for foo in foolist" multiple="">
</select>
</span>
</body>
'use strict';
function FooListCtrl($scope) {
$scope.foos = {"Bar": [ "foo", "bar"]};
$scope.selected = [];
}
FooListCtrl.$inject = ['$scope'];
运行代码:http: //jsfiddle.net/gBcN2/