mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-10 22:44:01 +08:00
style(ngViewSpec): pretify some tests with $destroy events
This commit is contained in:
@@ -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'));
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user