I need to use two different styles for two different looks of a page and I need different CSS and JavaScript files for that. Is there anyway I could conditionally render CSS and JavaScript files inside the head element in an html file?
I am working on an AngularJS application with Angular UI-Router module.
<html lang="en" ng-app="myApp">
<head>
<!-- if {{$state.current.name}} is "front" then list these CSS files -->
<!-- if {{$state.current.name}} is "admin" then list these CSS files -->
</head>
<body>
<!-- ... -->
<!-- if {{$state.current.name}} is "front" then list these JavaScript files -->
<!-- if {{$state.current.name}} is "admin" then list these JavaScript files -->
</body>
</html>
Could somebody help me with it?
ng-ifandng-srcof any help? As in,<link ng-if="condition" rel="stylesheet" ng-src="style.css">and similar for scripts? Just an idea.<link>elements based on a condition rather than havingng-ifon every<link>element? Could I have two<head>elements and render only one of them based on<head ng-if="condition">.. </head>? Would it be valid html?