我有一个angular-cli应用程序并使用webpack。 当我尝试运行它的成分具有特异性的CSS不起作用Angular-cli构建生成的CSS不起作用
styles.css的
/* You can add global styles to this file, and also import other style files*/
@import 'http://something/v4/dist/css/bootstrap.min.css';
组件
@Component({
selector: 'app-carousel',
templateUrl: './carousel.component.html',
styleUrls: ['./carousel.component.css']
})
export class CarouselComponent implements OnInit {
组件CSS
.carousel-indicators { display: none; }
角cli.config
"styles": [
"styles.css",
"../node_modules/roboto-fontface/css/roboto/sass/roboto-fontface-bold.scss",
"../node_modules/roboto-fontface/css/roboto/sass/roboto-fontface-light.scss",
"../node_modules/roboto-fontface/css/roboto/sass/roboto-fontface-regular.scss"
],
呈现的HTML
<style type="text/css">@import url(http://something/v4/dist/css/bootstrap.min.css);</style>
<style type="text/css">/* You can add global styles to this file, and also import other style files */
</style><style></style><style>.carousel-indicators[_ngcontent-c5] { display: none; }</style>
,但是这并不适用于我的HTML元素 '旋转木马指标' 如果我导入carousel.component.css
成styles.css
然后它的工作原理,但它在生成的html中出现两次
我正在寻找这样做的正确方法
也许是因为我混合scss和css? – Theo
我在这里找到了我的问题的答案:https://stackoverflow.com/questions/45788972/how-to-hide-ngb-carousel-indicators-and-prev-next-control – Theo