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
1212How to use ?
1313====
1414
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
1616
17+ ``` html
18+ <html ng-app =" my.app"
19+ ```
20+ 2. Add the module " angular.css.injector" to your AngularJS apps
21+ ```javascript
1722 angular.module( ' yourModule' , [ ' angular.css.injector' ]);
23+ ```
1824
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
2227 function MyCtrl($scope, cssInjector)
2328 {
2429 cssInjector.add( " /path/to/your/css/file.css" );
2530 }
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
2834 function MyCtrl($scope, cssInjector)
2935 {
3036 cssInjector.setSinglePageMode(true);
3137 }
38+ ```
3239
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
3442 function MyCtrl($scope, cssInjector)
3543 {
3644 cssInjector.removeAll();
3745 }
46+ ```
3847
3948====
4049Compatibility
You can’t perform that action at this time.
0 commit comments