Skip to content
This repository was archived by the owner on Feb 8, 2023. It is now read-only.

Commit 856d9d0

Browse files
Merge pull request #25 from petercrona/main
Remove dependency and instead use an isolated scope. This makes the ser...
2 parents f0a278a + bd38bb8 commit 856d9d0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

angular-css-injector.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ angular.module('angular.css.injector', [])
1010
.provider('cssInjector', ['$interpolateProvider', function($interpolateProvider) {
1111
var singlePageMode = false;
1212

13-
function CssInjector($compile, $rootScope, $rootElement){
13+
function CssInjector($compile, $rootScope){
1414
// Variables
1515
var head = angular.element(document.getElementsByTagName('head')[0]),
1616
scope;
@@ -27,7 +27,7 @@ angular.module('angular.css.injector', [])
2727
{
2828
if(scope === undefined)
2929
{
30-
scope = $rootElement.scope();
30+
scope = $rootScope.$new(true);
3131
}
3232
};
3333

@@ -82,8 +82,8 @@ angular.module('angular.css.injector', [])
8282
};
8383
}
8484

85-
this.$get = ['$compile', '$rootScope', '$rootElement', function($compile, $rootScope, $rootElement){
86-
return new CssInjector($compile, $rootScope, $rootElement);
85+
this.$get = ['$compile', '$rootScope', function($compile, $rootScope){
86+
return new CssInjector($compile, $rootScope);
8787
}];
8888

8989
this.setSinglePageMode = function(mode){

0 commit comments

Comments
 (0)