Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Customize content of Carousel Indicators #1587

Closed
jspizziri opened this issue May 26, 2017 · 2 comments
Closed

[Feature Request] Customize content of Carousel Indicators #1587

jspizziri opened this issue May 26, 2017 · 2 comments

Comments

@jspizziri
Copy link

It would be good to have the ability to customize the content of carousel indicators. An example use-case is if it's desired to put words indicating the slide. Theoretically this could be avoided by building a custom carousel indicators outside of NgbCarousel however that would depend on #1406, but even in that case it seems like a lot of overhead.

Thanks!

@tosrisri
Copy link

tosrisri commented Jul 8, 2020

You can't style it by using CSS or SCSS. You can achieve it by modifying the template string, here's how:
Goto node_modules > @ng-boostrap > ng-bootstrap > carousel > carousel.js
give inline style to the

  • element like below:
    ...
    template: "\n <ol class="carousel-indicators" *ngIf="showNavigationIndicators">\n <li style="background-color:black" *ngFor="let slide of slides" [id]="slide.id" [class.active]="slide.id === activeId"\n ...

    You are done.

    Screen Shot 2020-07-08 at 10 14 07 PM
    Here's the output
    Screen Shot 2020-07-08 at 10 14 45 PM

  • @tayambamwanza
    Copy link

    You can't style it by using CSS or SCSS. You can achieve it by modifying the template string, here's how:
    Goto node_modules > @ng-boostrap > ng-bootstrap > carousel > carousel.js
    give inline style to the

    • element like below:
      ...
      template: "\n <ol class="carousel-indicators" *ngIf="showNavigationIndicators">\n <li style="background-color:black" *ngFor="let slide of slides" [id]="slide.id" [class.active]="slide.id === activeId"\n ...
      You are done.
      Screen Shot 2020-07-08 at 10 14 07 PM
      Here's the output
      Screen Shot 2020-07-08 at 10 14 45 PM

    Hi, I'm attempting to change the color of the indicators. I saw you suggested editing the files in node_modules, would that not be wiped away anytime npm install is run though?

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants