@@ -81,7 +81,7 @@ const INDETERMINATE_ANIMATION_TEMPLATE = `
8181 host : {
8282 'role' : 'progressbar' ,
8383 'class' : 'mat-progress-spinner' ,
84- '[class._mat-animation-noopable]' : `_animationMode === 'NoopAnimations' ` ,
84+ '[class._mat-animation-noopable]' : `_noopAnimations ` ,
8585 '[style.width.px]' : 'diameter' ,
8686 '[style.height.px]' : 'diameter' ,
8787 '[attr.aria-valuemin]' : 'mode === "determinate" ? 0 : null' ,
@@ -110,6 +110,9 @@ export class MatProgressSpinner extends _MatProgressSpinnerMixinBase implements
110110 */
111111 private static styleTag : HTMLStyleElement | null = null ;
112112
113+ /** Whether the _mat-animation-noopable class should be applied, disabling animations. */
114+ _noopAnimations : boolean = this . animationMode === 'NoopAnimations' && this . platform . isBrowser ;
115+
113116 /** The diameter of the progress spinner (will set width and height of svg). */
114117 @Input ( )
115118 get diameter ( ) : number { return this . _diameter ; }
@@ -145,9 +148,9 @@ export class MatProgressSpinner extends _MatProgressSpinnerMixinBase implements
145148 }
146149
147150 constructor ( public _elementRef : ElementRef ,
148- platform : Platform ,
151+ public platform : Platform ,
149152 @Optional ( ) @Inject ( DOCUMENT ) private _document : any ,
150- @Optional ( ) @Inject ( ANIMATION_MODULE_TYPE ) public _animationMode ?: string ) {
153+ @Optional ( ) @Inject ( ANIMATION_MODULE_TYPE ) private animationMode ?: string ) {
151154
152155 super ( _elementRef ) ;
153156 this . _fallbackAnimation = platform . EDGE || platform . TRIDENT ;
@@ -236,7 +239,7 @@ export class MatProgressSpinner extends _MatProgressSpinnerMixinBase implements
236239 'role' : 'progressbar' ,
237240 'mode' : 'indeterminate' ,
238241 'class' : 'mat-spinner mat-progress-spinner' ,
239- '[class._mat-animation-noopable]' : `_animationMode === 'NoopAnimations' ` ,
242+ '[class._mat-animation-noopable]' : `_noopAnimations ` ,
240243 '[style.width.px]' : 'diameter' ,
241244 '[style.height.px]' : 'diameter' ,
242245 } ,
@@ -249,8 +252,8 @@ export class MatProgressSpinner extends _MatProgressSpinnerMixinBase implements
249252export class MatSpinner extends MatProgressSpinner {
250253 constructor ( elementRef : ElementRef , platform : Platform ,
251254 @Optional ( ) @Inject ( DOCUMENT ) document : any ,
252- @Optional ( ) @Inject ( ANIMATION_MODULE_TYPE ) _animationMode ?: string ) {
253- super ( elementRef , platform , document , _animationMode ) ;
255+ @Optional ( ) @Inject ( ANIMATION_MODULE_TYPE ) animationMode ?: string ) {
256+ super ( elementRef , platform , document , animationMode ) ;
254257 this . mode = 'indeterminate' ;
255258 }
256259}
0 commit comments