Open monxas opened 3 years ago
I find a workaround like import { CarouselComponent } from 'angular-responsive-carousel'; @ViewChild('sliderCarousel') sliderCarousel: CarouselComponent;
and call after adding new element to image array this.sliderCarousel.onWindowResize({})
I found a solution similar to @dren0r123 solution .. by add this.sliderCarousel.detectDomChanges(); intead of
this.sliderCarousel.onWindowResize({}) .
I find a workaround like import { CarouselComponent } from 'angular-responsive-carousel'; @ViewChild('sliderCarousel') sliderCarousel: CarouselComponent;
and call after adding new element to image array this.sliderCarousel.detectDomChanges();
The latest version has a resize()
method, try using it. It will update the data inside the carousel.
Right now we don't have an easy way to reload the carrousel and it would be an easy workaorund for many issues people might have.
For example, if you have a list of items and the list is dynamic it'll break.
An way to fix this in a generic way that I didn't fin how to do is to add a reload method to reload the carrousel whenever the new item is added.