I don't get to delete the ion-item of the ion-list


In my code, the ion-delete-button runs an animation when it is pushed. After 600ms, the item must be deleted with the function:

setTimeout(function(){$scope.items.splice($scope.items.indexOf(item), 1)},600);

The problem: this item isn’t deleted after this time. But if I push the ion-delete-item of other item, the item that I previously push is deleted, but not the item that I actually push.

If I execute the $scope.items.splice($scope.items.indexOf(item), 1) without the SetTimeout, its works perfectly. But then the animation no runs…

Anybody knows how resolve this problem?

Thanks in advance



  <ion-item ng-repeat="item in items" type="item-text-wrap" ng-init="animation='new-item'" ng-class="animation">
       <ion-delete-button class="ion-minus-circled" ng-click="animation='removed-item';onItemDelete(item)">


$scope.onItemDelete = function(item){
//600ms is the duration of the css animation
setTimeout(function(){$scope.items.splice($scope.items.indexOf(item), 1)},600);