Skip to content

Latest commit

 

History

History
17 lines (15 loc) · 546 Bytes

README.md

File metadata and controls

17 lines (15 loc) · 546 Bytes

Introduction

This angularjs module facilitates injecting a single view specific css stylesheet into the header for a specfic route.

Usage

First load the module:

var mymodule = angular.module('mymodule', ['ngRoute', 'ngCssInjector'])

Then tie stylesheets to routes:

mymodule.config(function($routeProvider, $stylesheetInjectorProvider){
    $routeProvider.when('/', { templateUrl:'home.html', resolve: {stylesheet: $stylesheetInjectorProvider.injectStylesheet('css/home.min.css')}});
});