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

How to add carousel-item after http request #447

Open
jaimeplier opened this issue Nov 29, 2019 · 0 comments
Open

How to add carousel-item after http request #447

jaimeplier opened this issue Nov 29, 2019 · 0 comments

Comments

@jaimeplier
Copy link

First of all thank uoy for all the effort put into maintaining this extension, It's very helpfull. I have a setup as follows:

<div #carousel class="carousel carousel-slider center" materialize="carousel" 
      [materializeParams]="[{transition: 1000, interval: 6000}]">
        <a class="carousel-item" *ngFor="let url of imageURLs">
            <img [src]="url" >
        </a>
      </div>

I have tried using the example code that is inside this project:

....
  @ViewChild('carousel', {static: false }) carouselElement;
...
window.setTimeout(() => {
      this.imageURLs = [this.imageURLs[0], ...this.imageURLs]; // duplicate the first iamge
      this.carouselElement.nativeElement.classList.toggle('initialized')
      this.actions.emit('carousel');
      this.actions.emit('carousel-slider');
    }, 1000);

The result is an item fixed to the background that doesn't respond to carousel events, my question is, what is the proper way to add this items?

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

1 participant