I am not able to clear data from object , after I delete it from the grid. here's : http://plnkr.co/edit/u1HmCwsEzVrgQJ2SLUgY?p=preview
I am using this to delete rows from grid.
angular.forEach($scope.mysel, function(rowItem) {
$scope.myData.splice($scope.myData.indexOf(rowItem), 1);
});
Issue 1:
You need to empty the original $scope.mysel
array instead of removing it:
while ($scope.mysel.length > 0) {
$scope.mysel.pop();
}
Issue 2:
Code example changed during answering, so not sure there originally was a second issue.
For clarity's sake, don't modify the array that is being iterated until the iteration has completed:
$scope.removeRow = function() {
angular.forEach($scope.mysel, function(rowItem) {
$scope.myData.splice($scope.myData.indexOf(rowItem), 1);
});
while ($scope.mysel.length > 0) {
$scope.mysel.pop();
}
};