angular-css
angular-css copied to clipboard
Dynamic CSS URL
Currently I am using a dynamic template URL using a function as given below in the Routes.
.when('/:page', {
templateUrl : function(url) {
return '/static/partials/' + url.page + '/template.html';
},
....
}
When I tried the same with CSS, it is unable to find "url"
css : function(url) {
return '/static/partials/' + url.page + '/styles.css';
}
Is there any chance that we can provide Dynamic CSS URL as mentioned above?
I have the same need, because I want to use themes depended on a param. Can you try this and report if it works:
css : function($stateParams) {
return '/static/partials/' + $stateParams.page + '/styles.css';
}
and
css : function($state) {
return '/static/partials/' + $state.params.page + '/styles.css';
}
When the functions returns an Array it only handles the last entry.
+1