forked from alexanderpa/angular-css-injector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathangular-css-injector.min.js
2 lines (2 loc) · 1.04 KB
/
angular-css-injector.min.js
1
2
/* https://github.com/Yappli/angular-css-injector v1.0.4 */
-"use strict";angular.module("angular.css.injector",[]).provider("cssInjector",function(){function t(e,t){var n=false,r=angular.element(document.getElementsByTagName("head")[0]),i;t.$on("$locationChangeStart",function(){if(n===true)u()});var s=function(){if(i===undefined){if((i=r.scope())===undefined)throw"angular.css.injector error : Please initialize your app in the HTML tag and be sure your page has a HEAD tag."}};var o=function(t){s();if(i.injectedStylesheets===undefined){i.injectedStylesheets=[];r.append(e("<link data-ng-repeat='stylesheet in injectedStylesheets' data-ng-href='{{stylesheet.href}}' rel='stylesheet' />")(i))}else{for(var n in i.injectedStylesheets){if(i.injectedStylesheets[n].href==t)return}}i.injectedStylesheets.push({href:t})};var u=function(){s();if(i.injectedStylesheets!==undefined)i.injectedStylesheets=[]};return{add:o,removeAll:u}}var e=false;this.$get=["$compile","$rootScope",function(e,n){return new t(e,n)}];this.setSinglePageMode=function(t){e=t;return this}})