angularJs批量删除

来源:互联网 发布:sql调用存储过程 参数 编辑:程序博客网 时间:2024/05/29 17:49
//批量删除
$scope.delSelect = function() {
var isSelected = [];
for(index in $scope.data) {
if($scope.data[index].done) {
if($scope.data[index].state == "已发货") {
isSelected.push($scope.data[index]);
}
}
}
for(index in isSelected) {
var name = isSelected[index].name;
for(index2 in $scope.data) {
if(name == $scope.data[index2].name) {
$scope.data.splice(index2, 1);
}
}
}
}
原创粉丝点击