This repository was archived by the owner on Feb 8, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -12,29 +12,38 @@ angular-css-injector is a AngularJS service allows you to load dynamically CSS f
12
12
How to use ?
13
13
====
14
14
15
- 1 . First, add the module "angular.css.injector" to your AngularJS apps
15
+ 1 . Your angular's app must be defined on the HTML tag of your page
16
16
17
+ ``` html
18
+ <html ng-app =" my.app"
19
+ ```
20
+ 2. Add the module " angular.css.injector" to your AngularJS apps
21
+ ```javascript
17
22
angular.module( ' yourModule' , [ ' angular.css.injector' ]);
23
+ ```
18
24
19
-
20
- 2 . Get this service where you want and add your css files in your HTML page ! Example here in a controller :
21
-
25
+ 3. Get this service where you want and add your css files in your HTML page ! Example here in a controller :
26
+ ```javascript
22
27
function MyCtrl($scope, cssInjector)
23
28
{
24
29
cssInjector.add( " /path/to/your/css/file.css" );
25
30
}
26
-
27
- 3 . To remove all added CSS files when the page change (in a single page application), set the single page mode :
31
+ ```
32
+ 4. To remove all added CSS files when the page change (in a single page application), set the single page mode :
33
+ ```javascript
28
34
function MyCtrl($scope, cssInjector)
29
35
{
30
36
cssInjector.setSinglePageMode(true);
31
37
}
38
+ ```
32
39
33
- 4 . To remove manually all added CSS files, call the function removeAll :
40
+ 5. To remove manually all added CSS files, call the function removeAll :
41
+ ```javascript
34
42
function MyCtrl($scope, cssInjector)
35
43
{
36
44
cssInjector.removeAll();
37
45
}
46
+ ```
38
47
39
48
====
40
49
Compatibility
You can’t perform that action at this time.
0 commit comments