mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Merge pull request #188 from sorich87/ionicList-cleanup
ionicList directives cleanup
This commit is contained in:
12
js/ext/angular/src/directive/ionicList.js
vendored
12
js/ext/angular/src/directive/ionicList.js
vendored
@@ -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();
|
||||
});
|
||||
}
|
||||
};
|
||||
}])
|
||||
|
||||
Reference in New Issue
Block a user