@@ -21,12 +21,12 @@ import {
2121 Injectable
2222} from '@angular/core' ;
2323import { IgxIconModule } from '../icon/index' ;
24- import { IBaseEventArgs } from '../core/utils' ;
24+ import { IBaseEventArgs , PlatformUtil } from '../core/utils' ;
2525import { Subject , merge } from 'rxjs' ;
2626import { takeUntil } from 'rxjs/operators' ;
2727import { IgxCarouselIndicatorDirective , IgxCarouselNextButtonDirective , IgxCarouselPrevButtonDirective } from './carousel.directives' ;
2828import { useAnimation , AnimationBuilder , AnimationPlayer , AnimationReferenceMetadata } from '@angular/animations' ;
29- import { slideInLeft , fadeIn , rotateInCenter } from '../animations/main' ;
29+ import { slideInLeft , fadeIn } from '../animations/main' ;
3030import { IgxSlideComponent , Direction } from './slide.component' ;
3131import { ICarouselResourceStrings } from '../core/i18n/carousel-resources' ;
3232import { CurrentResourceStrings } from '../core/i18n/resources' ;
@@ -436,7 +436,8 @@ export class IgxCarouselComponent implements OnDestroy, AfterContentInit {
436436 private animationPosition = 0 ;
437437 private newDuration = 0 ;
438438
439- constructor ( private element : ElementRef , private iterableDiffers : IterableDiffers , private builder : AnimationBuilder ) {
439+ constructor ( private element : ElementRef , private iterableDiffers : IterableDiffers ,
440+ private builder : AnimationBuilder , private platformUtil : PlatformUtil ) {
440441 this . differ = this . iterableDiffers . find ( [ ] ) . create ( null ) ;
441442 }
442443
@@ -887,7 +888,7 @@ export class IgxCarouselComponent implements OnDestroy, AfterContentInit {
887888 private restartInterval ( ) {
888889 this . resetInterval ( ) ;
889890
890- if ( ! isNaN ( this . interval ) && this . interval > 0 ) {
891+ if ( ! isNaN ( this . interval ) && this . interval > 0 && this . platformUtil . isBrowser ) {
891892 this . lastInterval = setInterval ( ( ) => {
892893 const tick = + this . interval ;
893894 if ( this . playing && this . total && ! isNaN ( tick ) && tick > 0 ) {
0 commit comments