|
1 | | -angularDynamicStylesheets |
| 1 | +Angular-css-injector |
2 | 2 | ========================= |
3 | 3 |
|
4 | | -A angularJS service to load dynamically CSS files |
| 4 | +A angularJS service to load dynamically CSS files. The original name of this project was angularDynamicStylesheets. |
5 | 5 |
|
6 | 6 | ===== |
7 | 7 | Description |
8 | 8 | ==== |
9 | | -angularDynamicStylesheets is a AngularJS service allows you to load dynamically CSS files in your HTML page. |
| 9 | +angular-css-injector is a AngularJS service allows you to load dynamically CSS files in your HTML page. |
10 | 10 |
|
11 | 11 | ==== |
12 | 12 | How to use ? |
13 | 13 | ==== |
14 | 14 |
|
15 | | -1. First, add the module "DynamicStylesheets" to your AngularJS apps |
| 15 | +1. First, add the module "angular.css.injector" to your AngularJS apps |
16 | 16 |
|
17 | | - angular.module('yourModule', ['DynamicStylesheets']); |
| 17 | + angular.module('yourModule', ['angular.css.injector']); |
18 | 18 |
|
19 | 19 |
|
20 | 20 | 2. Get this service where you want and add your css files in your HTML page ! Example here in a controller : |
21 | 21 |
|
22 | | - function MyCtrl($scope, dynamicStylesheets) |
| 22 | + function MyCtrl($scope, cssInjector) |
23 | 23 | { |
24 | | - dynamicStylesheets.add("/path/to/your/css/file.css"); |
| 24 | + cssInjector.add("/path/to/your/css/file.css"); |
25 | 25 | } |
26 | 26 |
|
27 | 27 | 3. To remove all added CSS files when the page change (in a single page application), set the single page mode : |
28 | | - function MyCtrl($scope, dynamicStylesheets) |
| 28 | + function MyCtrl($scope, cssInjector) |
29 | 29 | { |
30 | | - dynamicStylesheets.setSinglePageMode(true); |
| 30 | + cssInjector.setSinglePageMode(true); |
31 | 31 | } |
32 | 32 |
|
33 | 33 | 4. To remove manually all added CSS files, call the function removeAll : |
34 | | - function MyCtrl($scope, dynamicStylesheets) |
| 34 | + function MyCtrl($scope, cssInjector) |
35 | 35 | { |
36 | | - dynamicStylesheets.removeAll(); |
| 36 | + cssInjector.removeAll(); |
37 | 37 | } |
38 | 38 |
|
39 | 39 | ==== |
|
0 commit comments