Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Styles don't apply to sub-child routes in Angular

I was trying to add two sub-child routes to a child route as seen below, but when I execute the code the styles don't apply to the sub-child components and the console shows the following error:

Refused to apply style from 'http://localhost:4200/stations/styles.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled

And here's how I added the sub-child routes:

{
    path: '', component: HomeComponent,
    children: [
      { path: 'stations', component: StationsComponent, 
        children: [
        {path: 'add', component: AddComponent},
        {path: 'edit', component: EditComponent}
      ]},
      { path: 'vehicles', component: VehiclesComponent}
    ]
  }

and therefore not accepted as a valid stylesheet

enter image description here

I'm looking forward to your help.


1 Answers

In my case was missing </head> closing tag, in the file index.html

like image 177
Arthur Cabral Avatar answered Sep 20 '25 23:09

Arthur Cabral