Skip to content

Commit

Permalink
fix(carousel): fix 'changes' of undefined with ngFor
Browse files Browse the repository at this point in the history
  • Loading branch information
Enlcxx committed Feb 13, 2019
1 parent f330fb9 commit 01f728d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/carousel/carousel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,15 @@ export class LyCarousel implements OnInit, AfterViewInit, OnDestroy {
if (Platform.isBrowser) {
this._resetInterval();
}
this.lyItems.changes.pipe(takeUntil(this._destroy)).subscribe(() => this._markForCheck());
}

ngAfterViewInit() {
this._renderer.addClass(this.slideContainer.nativeElement, this.classes.slideContainer);
if (Platform.isBrowser) {
this._renderer.addClass(this.slideContainer.nativeElement, this.classes.slideAnim);
}

this.lyItems.changes.pipe(takeUntil(this._destroy)).subscribe(() => this._markForCheck());
}

ngOnDestroy() {
Expand Down

0 comments on commit 01f728d

Please sign in to comment.