Merge pull request #188 from sorich87/ionicList-cleanup

ionicList directives cleanup
This commit is contained in:
Adam Bradley
2013-11-27 06:36:32 -08:00
3 changed files with 127 additions and 5 deletions

View File

@@ -62,7 +62,7 @@ angular.module('ionic.ui.list', ['ngAnimate'])
button.onButtonClicked && button.onButtonClicked($scope.item, button);
};
list.scope.$watch('isEditing', function(v) {
var deregisterListWatch = list.scope.$watch('isEditing', function(v) {
$scope.isEditing = v;
// Add a delay before we allow the options layer to show, to avoid any odd
@@ -75,6 +75,10 @@ angular.module('ionic.ui.list', ['ngAnimate'])
$scope.showOptions = false;
}
});
$scope.$on('$destroy', function () {
deregisterListWatch();
});
}
};
}])
@@ -133,7 +137,7 @@ angular.module('ionic.ui.list', ['ngAnimate'])
button.onButtonClicked && button.onButtonClicked($scope.item, button);
};
list.scope.$watch('isEditing', function(v) {
var deregisterListWatch = list.scope.$watch('isEditing', function(v) {
$scope.isEditing = v;
// Add a delay before we allow the options layer to show, to avoid any odd
@@ -146,6 +150,10 @@ angular.module('ionic.ui.list', ['ngAnimate'])
$scope.showOptions = false;
}
});
$scope.$on('$destroy', function () {
deregisterListWatch();
});
}
};
}])