Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 1b8590a

Browse files
committed
revert: fix(ngMock): attach $injector to $rootElement
This reverts commit 88bb551. The fixes applied in the reverted commit caused a memory leak with JQuery + Karma.
1 parent 9955bd0 commit 1b8590a

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/ngMock/angular-mocks.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -2090,9 +2090,9 @@ angular.mock.$RAFDecorator = ['$delegate', function($delegate) {
20902090
*
20912091
*/
20922092
angular.mock.$RootElementProvider = function() {
2093-
this.$get = ['$injector', function($injector) {
2094-
return angular.element('<div ng-app></div>').data('$injector', $injector);
2095-
}];
2093+
this.$get = function() {
2094+
return angular.element('<div ng-app></div>');
2095+
};
20962096
};
20972097

20982098
/**

test/ngMock/angular-mocksSpec.js

-4
Original file line numberDiff line numberDiff line change
@@ -1667,10 +1667,6 @@ describe('ngMock', function() {
16671667
it('should create mock application root', inject(function($rootElement) {
16681668
expect($rootElement.text()).toEqual('');
16691669
}));
1670-
1671-
it('should attach the `$injector` to `$rootElement`', inject(function($injector, $rootElement) {
1672-
expect($rootElement.injector()).toBe($injector);
1673-
}));
16741670
});
16751671

16761672

0 commit comments

Comments
 (0)