0
votes

In my angular application. I'm using angular-bootstrap-md carousel but I don't know how to capture the slide change event.

  <mdb-carousel [animation]="'slide'" (slide)="onSlide($event)" >             
     <mdb-carousel-item> 
     <mdb-carousel-item>
  </mdb-carousel>

I have used the slide to capture the slide event but it's not working

 <mdb-carousel [animation]="'slide'" (slide)="onSlide($event)" >             
     <mdb-carousel-item> 
     <mdb-carousel-item>
  </mdb-carousel>
1

1 Answers

2
votes

The event you are looking for is activeSlideChange.

Reference: mdbootstrap carousel activeSlideChange event

<mdb-carousel [interval]="myInterval" [noWrap]="noWrapSlides" [(activeSlide)]="activeSlideIndex" (activeSlideChange)="activeSlideChange()">
   <mdb-slide *ngFor="let slide of slides; let index=index">
      <img [src]="slide.image">
        <div class="carousel-caption">
          <h4>Slide {{index}}</h4>
          <p>{{slide.text}}</p>
        </div>
   </mdb-slide>
</mdb-carousel>