My landing page and dashboard components have different CSS styling, causing one of them to not function properly depending on the CSS. I tried removing these two lines from index.html:
<link href="./assets/css/bootstrap.min.css" rel="stylesheet" />
<link href="./assets/css/paper-dashboard.css" rel="stylesheet"/>
Then, in angular.cli, I adjusted the styles array as follows:
"styles": [
"styles.css",
"../node_modules/bootstrap/dist/css/bootstrap.min.css",
"assets/sass/paper-kit.scss",
"assets/css/demo.css",
"assets/css/nucleo-icons.css"
]
After making these changes, my landing page component worked properly but the dashboard did not. However, when I added back the two lines to index.html and updated angular.cli like this:
"styles": [
"styles.css"
]
The landing page stopped working correctly while the dashboard began functioning correctly. I specified the styleUrls like this in my code, but they were not being applied correctly. Does anyone know how I can resolve this issue so that both components work properly? Should I set CSS for each component separately?
@Component({
selector: 'dashboard-cmp',
moduleId: module.id,
templateUrl: 'dashboard.component.html',
styleUrls: [
'../../assets/css/paper-dashboard.css',
'../../assets/css/bootstrap.min.css'
]
})
UPDATE
I noticed that when the angular.cli styles are configured like this:
"styles": [
"styles.css",
"assets/css/bootstrap.min.css",
"assets/sass/paper-kit.scss",
"assets/css/demo.css",
"assets/css/nucleo-icons.css",
"assets/css/paper-dashboard.css"
]
The dashboard component works properly, but the landing page does not. When I change the styles configuration to:
"styles": [
"styles.css",
"../node_modules/bootstrap/dist/css/bootstrap.min.css",
"assets/sass/paper-kit.scss",
"assets/css/demo.css",
"assets/css/nucleo-icons.css",
"assets/css/paper-dashboard.css"
]
The landing page starts working correctly, but the dashboard stops functioning. I attempted setting styleUrls like this in dashboard.component.ts: ['./dashboard.component.css']
, and adding
@import url('/../../assets/css/bootstrap.min.css');
in dashboard.component.css, but the issue persists. Any suggestions on what might be causing this?