Hello, I am currently attempting to add CSS dynamically but for some reason it is not working. Below you will find the code that I have been using:
angular.module('myApp', [ 'myApp.controllers','myApp.services']).
config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/new', { templateUrl: 'partials/add.html', controller: 'add' ,resolve: {
style : function(){
/* Check if the stylesheet already exists - note the ID used on the link element*/
/* Another option could be to track this within a scope object */
alert("DSAF");
angular.element('head').append(' <link rel="stylesheet" href="css/app.css"/>');
}
}}) }]);