Closed elekwent closed 7 years ago
same issu
Hi, ok, I had the same problem and the tutorial is wrong in one place. With the latest version of the angular cli, you no longer have to include the <link rel="stylesheet"...> in the index.html file. The cli will inject the contents automatically. So remove that line from the index.html and all should work. The files that get injected are specified in the .angular-cli.json file, and this works because the styles.css is already preconfigured there for you-
ref - https://github.com/angular/angular-cli/wiki/stories-global-styles
closing since this was rewritten with the CLI
@chriszrc lol
Okay Recently I fetched this problem I have very simple solution for solve this Issue , follow these steps:
go to these directories src-> app-> index.html open the index.html and find
<base href="your app name ">
change this to <base href="/">
Hey , I have once query here. If we use # in place of "/". it is not able to find css. I am using scss.
The last step in the Routing Tutorial is to apply a global style to the application. After following the instructions for doing so, I get an error in the browser:
GET http://localhost:4200/styles.css
. The app is being served using the CLI command:ng serve
(if that makes any difference). The styles.css file is located at the default location where the CLI created it. Why can't the browser find the file?index.html
src directory (filtered for relevance)