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

Carousel: can't add/remove slides after initialization #1562

Closed
chrisbenseler opened this issue May 19, 2017 · 2 comments
Closed

Carousel: can't add/remove slides after initialization #1562

chrisbenseler opened this issue May 19, 2017 · 2 comments

Comments

@chrisbenseler
Copy link

chrisbenseler commented May 19, 2017

If I have a template that uses carousel, like this:

<ngb-carousel>
  <ng-template ngbSlide *ngFor="let r of resources">
      <img src="{{ r.fileurl }}" alt="{{ r.name }}">
    </ng-template>
</ngb-carousel>

the carousel is initialized at the first time with the values from the 'resources' array. But if I change this array (adding or removing), the slides update in some weird way: the slides list from the object updated, but no image is shown.

@tproenca
Copy link

I'm having exactly this problem? Any news about it?

@impankratov
Copy link

@tproenca and for others who had problems with this:

<ngb-carousel>
  <!-- Outer template for ngForOf -->
  <ng-template ngFor let-item [ngForOf]="items">
    <!-- Inner template for NgbCarousel -->
    <ng-template ngbSlide>
      <div class="custom-class">
        Your content
      </div>
    </ng-template>
  </ng-template>
</ngb-carousel>

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

No branches or pull requests

3 participants