What is the proper/accepted way to use separate stylesheets for the various views my application uses?
Currently I'm placing a link element in the view/partial's html at the top but I've been told this is bad practice even though all modern browsers support it but I can see why it's frowned upon.
The other possibility is placing the separate stylesheets in my index.html's head
but I would like it to only load the stylesheet if its view is being loaded in the name of performance.
Is this bad practice since styling won't take effect until after the css is loaded form the server, leading to a quick flash of unformatted content in a slow browser? I have yet to witness this although I'm testing it locally.
Is there a way to load the CSS through the object passed to Angular's $routeProvider.when
?
Thanks in advance!
Could append a new stylesheet to head within
$routeProvider
. For simplicity am using a string but could create new link element also, or create a service for stylesheetsBiggest benefit of prelaoding in page is any background images will already exist, and less lieklyhood of
FOUC