Angular 2: how do I make it impossible to display HTML content when an external style file is not loaded or missing?

what happens now is that if I delete the CSS style file on the server side, the running project will report an error that the CSS file cannot be found, but the HTML content will still be displayed, but the styles will all be messed up.

I also know that in general, there is no missing CSS file, but it is always necessary to prevent it. So I just want to ask, how can you make it impossible to display CSS content if the HTML file is not loaded successfully or missing? It is better not to show it than to be in a mess.

Can

be realized? How to achieve it? Is there any specific operation?

ask for advice ~


add a style='display: none'

to the outer dom Add a .show {display: block! important;}

to the dom in

css.

if css is not loaded, it will not be displayed.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e9a6ec-4eca6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e9a6ec-4eca6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?