Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b830f5b

Browse files
committed
revert: fix(ngMock): attach $injector to $rootElement
This reverts commit fad4dc0. The fixes applied in the reverted commit caused a memory leak with JQuery + Karma.
1 parent 7e7a069 commit b830f5b

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/ngMock/angular-mocks.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1880,9 +1880,9 @@ angular.mock.$RAFDecorator = ['$delegate', function($delegate) {
18801880
*
18811881
*/
18821882
angular.mock.$RootElementProvider = function() {
1883-
this.$get = ['$injector', function($injector) {
1884-
return angular.element('<div ng-app></div>').data('$injector', $injector);
1885-
}];
1883+
this.$get = function() {
1884+
return angular.element('<div ng-app></div>');
1885+
};
18861886
};
18871887

18881888
/**

test/ngMock/angular-mocksSpec.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1596,10 +1596,6 @@ describe('ngMock', function() {
15961596
it('should create mock application root', inject(function($rootElement) {
15971597
expect($rootElement.text()).toEqual('');
15981598
}));
1599-
1600-
it('should attach the `$injector` to `$rootElement`', inject(function($injector, $rootElement) {
1601-
expect($rootElement.injector()).toBe($injector);
1602-
}));
16031599
});
16041600

16051601

0 commit comments

Comments
 (0)