I am using two visual templates for a particular site, whose css conflicts quite a bit, so rather than doing a painful edit, I figured dynamic loading would do the trick.
So I use this in my <head>
<!-- css is loaded dynamically through angular -->
<link ng-repeat="item in css.files" ng-href="{{item}}" rel="stylesheet">
And set $rootScope.css.files inside my .config() of my module.
The CSS loads fine, however there is a noticeable delay between loading the page content, and loading the CSS. Basically the unstyled html displays for a moment until the CSS files have completely loaded.
Is there any way to stop the page showing before the CSS has loaded? Is there any event for load completion of an ng-href item?
ng-cloakon your body element might be an option here. See docs.angularjs.org/api/ng.directive:ngCloak.