mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-13 17:23:11 +00:00
style(ngViewSpec): pretify some tests with $destroy events
This commit is contained in:
parent
9b1aff905b
commit
bca96e7c7c
1 changed files with 2 additions and 10 deletions
|
|
@ -317,11 +317,7 @@ describe('ng-view', function() {
|
||||||
var createCtrl = function(name) {
|
var createCtrl = function(name) {
|
||||||
return function($scope) {
|
return function($scope) {
|
||||||
log.push('init-' + name);
|
log.push('init-' + name);
|
||||||
var destroy = $scope.$destroy;
|
$scope.$on('$destroy', function() {log.push('destroy-' + name);});
|
||||||
$scope.$destroy = function() {
|
|
||||||
log.push('destroy-' + name);
|
|
||||||
destroy.call($scope);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -369,11 +365,7 @@ describe('ng-view', function() {
|
||||||
function createController(name) {
|
function createController(name) {
|
||||||
return function($scope) {
|
return function($scope) {
|
||||||
log.push('init-' + name);
|
log.push('init-' + name);
|
||||||
var destroy = $scope.$destroy;
|
$scope.$on('$destroy', logger('destroy-' + name));
|
||||||
$scope.$destroy = function() {
|
|
||||||
log.push('destroy-' + name);
|
|
||||||
destroy.call($scope);
|
|
||||||
}
|
|
||||||
$scope.$on('$routeUpdate', logger('route-update'));
|
$scope.$on('$routeUpdate', logger('route-update'));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue