Skip to content

Commit

Permalink
feat(): add restartCarousel method #144
Browse files Browse the repository at this point in the history
  • Loading branch information
Ks89 committed Aug 10, 2018
1 parent cc5e292 commit c563cbf
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,19 @@ export class CarouselComponent extends AccessibleComponent implements OnInit, Af
}
}

restartCarousel() {
if (isPlatformBrowser(this._platformId)) {
this._ngZone.runOutsideAngular(() => {
this.interval = setInterval(() => {
this._ngZone.run(() => {
this.currentImage = this.images[0];
this.ref.markForCheck();
});
}, this.intervalTime);
});
}
}

stopCarousel() {
if (isPlatformBrowser(this._platformId)) {
this._ngZone.runOutsideAngular(() => {
Expand Down

0 comments on commit c563cbf

Please sign in to comment.