Skip to content

Commit f0157fe

Browse files
authored
Merge pull request #6325 from IgniteUI/carousel-ssr-fix-82x
fix(ssr): Fix Carousel SSR rendering
2 parents 0faffd9 + 75a240a commit f0157fe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

projects/igniteui-angular/src/lib/carousel/carousel.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
Output
1313
} from '@angular/core';
1414
import { IgxIconModule } from '../icon/index';
15-
import { IBaseEventArgs } from '../core/utils';
15+
import { IBaseEventArgs, PlatformUtil } from '../core/utils';
1616

1717
let NEXT_ID = 0;
1818

@@ -202,7 +202,7 @@ export class IgxCarouselComponent implements OnDestroy {
202202
private _destroyed: boolean;
203203
private _total = 0;
204204

205-
constructor(private element: ElementRef) { }
205+
constructor(private element: ElementRef, private platformUtil: PlatformUtil) { }
206206
/**
207207
*@hidden
208208
*/
@@ -465,7 +465,7 @@ export class IgxCarouselComponent implements OnDestroy {
465465
private _restartInterval() {
466466
this._resetInterval();
467467

468-
if (!isNaN(this.interval) && this.interval > 0) {
468+
if (!isNaN(this.interval) && this.interval > 0 && this.platformUtil.isBrowser) {
469469
this._lastInterval = setInterval(() => {
470470
const tick = +this.interval;
471471
if (this._playing && this.total && !isNaN(tick) && tick > 0) {

0 commit comments

Comments
 (0)