This is a simple module for AngularJS that provides the ability to have route-specific CSS stylesheets, by integrating with Angular's built-in
What does it do?
It allows you to declare partial-specific or route-specific styles for your app using
$routeProvider service. For example, if you are already using
$routeProvider, you know that it allows you to easily setup your SPA routes by declaring
.when() block and telling Angular what template (or templateUrl) to use for each
route, and also which controller to associate with that route. Well, up until now, Angular
did not provide a way to add specific CSS stylesheets that should be dynamically loaded
when the given route is hit. This solves that problem.
How to install:
1) Download or clone this repository
2) Include the
route-styles.js file to your
3) Declare the
'routeStyles' module as a dependency in your main app
NOTE: you must also include the
ngRoute service module from angular, or at least make the
module available by adding the
to your html page.
4) Add your route-specific styles to the
$routeProvider in your app's config
PLEASE SEE THE GITHUB REPO's README FILE FOR MORE DETAILS ON HOW TO INSTALL THIS MODULE