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

Commit 95838fe

Browse files
Gabriel DelépineGabriel Delépine
authored andcommitted
Throw an exception if HEAD's scope is undefined
1 parent e63a884 commit 95838fe

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

angular-css-injector.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* angular-css-injector v1.0.3 beta1
2+
* angular-css-injector v1.0.3 beta2
33
* Written by Gabriel Delépine
44
* Special thanks to (github users) : @kleiinnn
55
* License: MIT
@@ -26,7 +26,10 @@ angular.module('angular.css.injector', [])
2626
var _initScope = function()
2727
{
2828
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.
29+
{
30+
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.
31+
throw("angular.css.injector error : Please initialize your app in the HTML tag and be sure your page has a HEAD tag.");
32+
}
3033
};
3134

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

0 commit comments

Comments
 (0)