8000 GitHub - GabrielDelepine/angular-css-injector at 0.2.1
[go: up one dir, main page]

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

GabrielDelepine/angular-css-injector

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

angularDynamicStylesheets

A angularJS service to load dynamically CSS files

===== Description

angularDynamicStylesheets is a AngularJS service allows you to load dynamically CSS files in your HTML page.

==== How to use ?

  1. First, add the module "DynamicStylesheets" to your AngularJS apps

    angular.module('yourModule', ['DynamicStylesheets']);

  2. Get this service where you want and add your css files in your HTML page ! Example here in a controller :

    function MyCtrl($scope, dynamicStylesheets) { dynamicStylesheets.add("/path/to/your/css/file.css"); }

  3. To remove all added CSS files when the page change (in a single page application), set the single page mode : function MyCtrl($scope, dynamicStylesheets) { dynamicStylesheets.setSinglePageMode(true); }

  4. To remove manually all added CSS files, call the function removeAll : function MyCtrl($scope, dynamicStylesheets) { dynamicStylesheets.removeAll(); }

==== Compatibility

IE >= 8

FF >= 3.5

Chrome >= 4

Opera >= 10

To make it IE7 compatible, delete "queryselector" in the code but you will need to include jQuery in your page. About "queryselector" compatibility : http://caniuse.com/queryselector

==== Dependencies

No one (only angular of course).

Code tested with angular 1.0.8

About

A angularJS service to load dynamically CSS files

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published
0