Notes From a Full-Stack Developer

Kevin Raffay's WordPress Blog

Angular 4 and CSS

leave a comment »

I was working through the latest Angular tutorial and had some trouble getting a stylesheet to work.  This was the styles.css at the root and the tutorial told me to merely add a link to the css in the index.html as usual:

<link rel=”stylesheet” href=”styles.css”>

I quickly found an SO post explaining that I had to add any stylesheet to the .angular-cli.json file, but when I checked, I did have a “styles.css” entry.  I still saw the missing file warning, and then saw on SO that I was not the only one to experience this.  Evidently, you can’t use css links in Angular html pages — the css files in the .angular-cli.json auto-magically get bundled and download to the client!





Written by Kevin Raffay

August 29, 2017 at 10:42 pm

Posted in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: