how to hide ngb-carousel indicators and prev-next control

那年仲夏 提交于 2019-12-09 03:24:08

问题


I can't hide the ngb-carousel indicators and prev-next control trough the css, targeting the css class wouldn't work. Is there any option to hide it?


回答1:


In order to affect the css of the ng-bootstrap components, you have to disable ViewEncapsulation.

Import it from @angular/core:

import { ViewEncapsulation } from '@angular/core'

Then disable it for this component in the @Component declaration:

@Component({
  encapsulation: ViewEncapsulation.None,
  selector: 'your-template-name',
  styleUrls: ['your-template-name.component.scss'],
  template: ` 
... `
})

Then you can target the Bootstrap classes etc. as you'd expect in your css file.

You want to disable this on a per-component basis, and only when you need to.



来源:https://stackoverflow.com/questions/45788972/how-to-hide-ngb-carousel-indicators-and-prev-next-control

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!