angular-route-styles

This is a simple module for AngularJS that provides the ability to have route-specific CSS stylesheets, by integrating with Angular's built-in $routeProvider service.
Homepage:
2 people use it
Author: 1782077?v=3 tennisgent

angular-route-styles

This is a simple module for AngularJS that provides the ability to have route-specific CSS stylesheets, by integrating with Angular's built-in $routeProvider service.

What does it do?

It allows you to declare partial-specific or route-specific styles for your app using Angular's built-in $routeProvider service. For example, if you are already using $routeProvider, you know that it allows you to easily setup your SPA routes by declaring a .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 index.html file

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 angular-route.js (or angular-route.min.js) script 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

comments powered by Disqus
This page was last updated about 3 years ago.