I have User angular.forEach to push all the data and I have to remove all the data which I was pushed, So I used splice but it's not working. What I have to do instead of splice or is any method to remove all array.
Following is my code:
angular.forEach($scope.resourcedetails, function(resdata) {
console.log(resdata);
var removelength = $scope.resourcedetails.length;
$scope.adduser.push(resdata);
console.log($scope.adduser.length);
if (removelength >=0) {
$scope.resourcedetails.splice(0, removelength)
}
});