refactor(slideBox): make it so elements are properly removed

This commit is contained in:
Andrew
2014-10-08 16:10:28 -06:00
parent 2cb56283ac
commit 7d2945f95d
3 changed files with 6 additions and 7 deletions

View File

@@ -7,8 +7,7 @@ function(scope, element, $q) {
var self = this;
scope.$on('$destroy', function() {
element.removeData();
detachSlide();
attachSlide();
});
element.on(ionic.CSS.TRANSITIONEND, onTransitionEnd);

View File

@@ -20,9 +20,9 @@ IonicModule
var dragEndGesture = ionic.onGesture('dragend', handleDragEnd, element[0]);
scope.$on('$destroy', function() {
ionic.offGesture(dragStartGesture);
ionic.offGesture(dragGesture);
ionic.offGesture(dragEndGesture);
ionic.offGesture(dragStartGesture, 'dragstart', handleDragStart);
ionic.offGesture(dragGesture, 'drag', handleDrag);
ionic.offGesture(dragEndGesture, 'dragend', handleDragEnd);
});
var dragState;

View File

@@ -45,7 +45,7 @@
<div ng-controller="SlideCtrl">
<ion-content>
<ion-slide-box selected="$root.selectedIndex" loop="true">
<ion-slide-box selected="$root.selectedIndex" loop="true" ng-if="$root.hasBox">
<ion-slide ng-controller="FirstSlideCtrl">
<h3>Thank you for choosing the Awesome App!</h3>
<div id="logo">
@@ -94,7 +94,7 @@
.controller('SlideCtrl', function($scope, $timeout) {
$scope.items = [];
for (var i = 0; i < 10; i++) {
for (var i = 0; i < 1000; i++) {
$scope.items.push(i);
}