这里我正在尝试删除多条记录,但我不明白为什么它在我正在进行时没有约束foreach
Controller.Js
$scope.DeleteAll = function (CustDelete) {
alert('delete')
var itemList = [];
angular.forEach(CustDelete, function (value, key) {
itemList.push(CustDelete[key].selected);
})
}
表格
<div ng-controller="UserCtrls">
<input type="button" value="Delete" ng-model="Del" ng click="DeleteAll(CustDelete)" />
<table class="table table-responsive table-bordered">
<tr>
<td><b>CheckAll
<input type="checkbox" ng-model="chk" />
</b></td>
<td><b>UserId</b></td>
</tr>
<tr ng-repeat="ee in UserDatainfos">
<td>
<input type="checkbox" ng-checked="chk" id="chk1" ng-true-value="{{ee.UserId}}" ng-false-value="" ng-model="ee.selected" />
</td>
<td>{{ee.UserId}}</td>
</tr>
</div>