diff --git a/js/angular/directive/slide.js b/js/angular/directive/slide.js index 6aeecc404e..61e34a8144 100644 --- a/js/angular/directive/slide.js +++ b/js/angular/directive/slide.js @@ -34,23 +34,9 @@ IonicModule element.addClass('slider-slide'); slideBoxCtrl.add(slideCtrl); - scope.$on('$destroy', function() { + element.on('$destroy', function() { slideBoxCtrl.remove(slideCtrl); }); - // Move with ng-repeat if this slide is part of ng-repeat. - // scope.$index only appears after the first time ng-repaet inserts the element. - function watchNgRepeatIndexOnInsertElement() { - if (angular.isNumber(scope.$index)) { - scope.$watch('$index', function(newIndex, oldIndex) { - if (!isDefined(oldIndex)) return; - var difference = newIndex - oldIndex; - var currentIndex = slideBoxCtrl.indexOf(slideCtrl); - - slideBoxCtrl.move(slideCtrl, currentIndex + difference); - }); - } - } - } }]); diff --git a/js/angular/service/slideBoxDelegate.js b/js/angular/service/slideBoxDelegate.js index dcba460e30..5869f33942 100644 --- a/js/angular/service/slideBoxDelegate.js +++ b/js/angular/service/slideBoxDelegate.js @@ -93,9 +93,10 @@ IonicModule * @ngdoc method * @name $ionicSlideBoxDelegate#update * @description Causes the slidebox to re-scan all of the child slide - * elements and reorganize itself again. + * elements and reorganize itself again. This will rarely be needed. * You only need to call update if you are moving slides around in the DOM - * (for example, ng-repeat moving an element from the middle to the end). + * (for example, ng-repeat moving an element from the middle to the end of + * the list). */ 'update', /**