SuperVeetz SuperVeetz - 5 months ago 23
AngularJS Question

Stylesheets load but are empty on page refresh in nested state

I'm having an issue where if I refresh the page in a state that is nested in my AngularJS app, the browser shows that my stylesheets were loaded, but they are empty for some reason. I am using ui-router. There are no errors in my console. I am not sure if this has anything to do with the server, but I am using NodeJS with LoopBack framework.

View my issue here

If you navigate to one of the top-level states and refresh the page, the styles will appear.

Answer

You'll want to use a domain relative url for your stylesheet.

<link rel="stylesheet" type="text/css" href="/css/styles.css">

This will load your stylesheet from http://70.78.5.204:3000/css/styles.css