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

Commit c857ce3

Browse files
committed
Merge branch 'yappli/main'
2 parents ede88b2 + 1c3136e commit c857ce3

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

README.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,12 @@ Chrome >= 4
5555

5656
Opera >= 10
5757

58-
59-
To make it IE7 compatible, delete "queryselector" in the code but you will need to include jQuery in your page.
60-
About "queryselector" compatibility : http://caniuse.com/queryselector
61-
6258
====
6359
Dependencies
6460
====
65-
No one (only angular of course) for major browser.
66-
jQuery if you need to make your website IE6 & IE7 compatible.
61+
No one (only angular of course).
6762

68-
Code tested with angular 1.0.8 & angular 1.2.3
63+
Code tested with angular 1.2.14
6964

7065
====
7166
Previous version

angular-css-injector.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
'use strict';
12
/*
2-
* angular-css-injector v1.0.2
3+
* angular-css-injector v1.0.3.1
34
* Written by Gabriel Delépine
45
* Special thanks to (github users) : @kleiinnn
56
* License: MIT
@@ -12,7 +13,7 @@ angular.module('angular.css.injector', [])
1213
function CssInjector($compile, $rootScope){
1314
// Variables
1415
var singlePageMode = false,
15-
head = angular.element(typeof jQuery == "undefined" ? document.querySelector('head') : 'head'), // TO make the code IE < 8 compatible, include jQuery in your page
16+
head = angular.element(document.getElementsByTagName('head')[0]),
1617
scope;
1718

1819
// Capture the event `locationChangeStart` when the url change. If singlePageMode===TRUE, call the function `removeAll`
@@ -26,7 +27,10 @@ angular.module('angular.css.injector', [])
2627
var _initScope = function()
2728
{
2829
if(scope === undefined)
29-
scope = head.scope(); // We initialise head's scope in a separated function because it is not defined at the time of the initialisation of the service.
30+
{
31+
if((scope = head.scope()) === undefined) // We initialise head's scope in a separated function because it is not defined at the time of the initialisation of the service.
32+
throw("angular.css.injector error : Please initialize your app in the HTML tag and be sure your page has a HEAD tag.");
33+
}
3034
};
3135

3236
// Used to add a CSS files in the head tag of the page

angular-css-injector.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)