aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorIgor Minar2012-03-16 10:52:20 -0700
committerIgor Minar2012-03-16 10:52:40 -0700
commitbca96e7c7cc723a091241fddd6845d6de262a3c9 (patch)
tree016acfd0f25d9f1a7389d8089001d67644d21f73 /test
parent9b1aff905b638aa274a5fc8f88662df446d374bd (diff)
downloadangular.js-bca96e7c7cc723a091241fddd6845d6de262a3c9.tar.bz2
style(ngViewSpec): pretify some tests with $destroy events
Diffstat (limited to 'test')
-rw-r--r--test/directive/ngViewSpec.js12
1 files changed, 2 insertions, 10 deletions
diff --git a/test/directive/ngViewSpec.js b/test/directive/ngViewSpec.js
index 7b702e51..bf3706ac 100644
--- a/test/directive/ngViewSpec.js
+++ b/test/directive/ngViewSpec.js
@@ -317,11 +317,7 @@ describe('ng-view', function() {
var createCtrl = function(name) {
return function($scope) {
log.push('init-' + name);
- var destroy = $scope.$destroy;
- $scope.$destroy = function() {
- log.push('destroy-' + name);
- destroy.call($scope);
- }
+ $scope.$on('$destroy', function() {log.push('destroy-' + name);});
};
};
@@ -369,11 +365,7 @@ describe('ng-view', function() {
function createController(name) {
return function($scope) {
log.push('init-' + name);
- var destroy = $scope.$destroy;
- $scope.$destroy = function() {
- log.push('destroy-' + name);
- destroy.call($scope);
- }
+ $scope.$on('$destroy', logger('destroy-' + name));
$scope.$on('$routeUpdate', logger('route-update'));
};
}