Skip to content

Commit 75a240a

Browse files
committed
fix(ssr): isBrowser check _restartInterval #6199
1 parent 0fba4d6 commit 75a240a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,8 @@ export class IgxCarouselComponent implements OnDestroy {
112112
* @memberof IgxCarouselComponent
113113
*/
114114
set interval(value: number) {
115-
if (this.platformUtil.isBrowser) {
116-
this._interval = +value;
117-
this._restartInterval();
118-
}
115+
this._interval = +value;
116+
this._restartInterval();
119117
}
120118
/**
121119
* Returns the `tabIndex` of the carousel component.
@@ -467,7 +465,7 @@ export class IgxCarouselComponent implements OnDestroy {
467465
private _restartInterval() {
468466
this._resetInterval();
469467

470-
if (!isNaN(this.interval) && this.interval > 0) {
468+
if (!isNaN(this.interval) && this.interval > 0 && this.platformUtil.isBrowser) {
471469
this._lastInterval = setInterval(() => {
472470
const tick = +this.interval;
473471
if (this._playing && this.total && !isNaN(tick) && tick > 0) {

0 commit comments

Comments
 (0)