Error GET files css or js: 404 Not Found

Remove that link to your stylesheet from your index.html. You’re using the angular-cli and in your configuration, styles.css is being included by the angular-cli. Your link tag in the HTML isn’t doing anything.

(The angular cli is also dynamically injecting a link tag for that style into your html, which is why ‘it works’).

I modified my angular-cli.json :

“apps”: [
{
“root”: “src”,
“outDir”: “dist”,
“assets”: [
“assets”,
“favicon.ico”
],
“index”: “index.html”,
“main”: “main.ts”,
“polyfills”: “polyfills.ts”,
“test”: “test.ts”,
“tsconfig”: “tsconfig.app.json”,
“testTsconfig”: “tsconfig.spec.json”,
“prefix”: “app”,
“styles”: [
“styles.css”,
“select.css”
],
“scripts”: [],
“environmentSource”: “environments/environment.ts”,
“environments”: {
“dev”: “environments/environment.ts”,
“prod”: “environments/environment.prod.ts”
}
}
],

Leave a Reply