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

Commit b9b82a9

Browse files
Gabriel DelépineGabriel Delépine
authored andcommitted
Don't depends on jQuery anymore. Compatibility IE >= 8.
angular.element do not support the selectors so I use : angular.element(document.querySelector('head')) To make the code IE7 compatible, use angular.element('head') but you will need to include jQuery in your page.
1 parent 40941a4 commit b9b82a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

angularDynamicStylesheets.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ angular.module('DynamicStylesheets', [])
2525
var _initScope = function()
2626
{
2727
if(scope === undefined)
28-
scope = angular.element('head').scope();
28+
scope = angular.element(document.querySelector('head')).scope();
2929
};
3030

3131
// Used to add a CSS files in the head tag of the page
@@ -36,7 +36,7 @@ angular.module('DynamicStylesheets', [])
3636
if(scope.href_array_dynamicStylesheets === undefined)
3737
{
3838
scope.href_array_dynamicStylesheets = [];
39-
angular.element('head').append($compile("<link data-ng-repeat='stylesheet in href_array_dynamicStylesheets' data-ng-href='{{stylesheet.href}}' rel='stylesheet' />")(scope)); // Found here : http://stackoverflow.com/a/11913182/1662766
39+
angular.element(document.querySelector('head')).append($compile("<link data-ng-repeat='stylesheet in href_array_dynamicStylesheets' data-ng-href='{{stylesheet.href}}' rel='stylesheet' />")(scope)); // Found here : http://stackoverflow.com/a/11913182/1662766
4040
}
4141
else
4242
{

0 commit comments

Comments
 (0)