问题
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