Deleting items from ion-slide-box

Hey

I have a ion-slide-box currently with 3 test slides. I want to implement functionality to delete a slide, but even though I call $ionicSlideBoxDelegate.update(); after removing the item from the array with the slides it does not seem to be updated properly, and it skips to the third slide even when deleting the first. The slide disappears, but it’s not possible to swipe to other slides. When looking at the html generated I can see that the data-index and translation of the slides is not updated, as well as the width of the entire slider. I tried to call update on on-slide-changed, and then the slides are updated when I try to swipe a couple of times, but I can’t use it like that.

Can anyone see what I have done wrong? Or why it is updated when swiping towards the empty area at the end of the slider?

<ion-slide-box active-slide="activeSlide" show-pager="false" on-slide-changed="slideChanged()">
        <ion-slide ng-repeat="story in stories">...</ion-slide>
</ion-slide-box>

Controller:

$scope.rejectStory = function(index) {
  $scope.stories.splice(index, 1);
  $ionicSlideBoxDelegate.update();
};

$scope.slideChanged = function () {
  $ionicSlideBoxDelegate.update();
};

Can you reproduce this in a codepen?

Reproduced the problem here: http://codepen.io/rakrogh/pen/qEzqKg

Well, it seems there is a bug:

I managed to make it work but sometimes there is a weird behaviour. When you remove a slide, add:

$ionicSlideBoxDelegate._instances[0].kill();
$ionicSlideBoxDelegate.update();

Thanks! That solution looks like it works, just had to also make it go to the previous slide when removing the last one.

The solution works fine in the browser, but when testing on a device you can’t swipe after having deleted a slide. Any idea why? I have arrow buttons too, and it works when clicking those, which just run $ionicSlideBoxDelegate.next(; and $ionicSlideBoxDelegate.previous()