列表数据多选与全选

/**
 * 选中全部
 */
$scope.tableAllSelect = function(){
angular.forEach( $scope.dw.rs,function(value,key){
value.choose =!$scope.choose;
  });
$scope.choose = !$scope.choose;
}
/**
 * 选中单个
 */
$scope.tableSelect = function(item){
item.choose = !item.choose;
var chooseNum = 0;
angular.forEach( $scope.dw.rs,function(value,key){
if(value.choose == true){
chooseNum++
}
  });
if($scope.dw.rs.length == chooseNum){
$scope.choose = true;
}else{
$scope.choose = false;
}
}

你可能感兴趣的:(java)