@@ -81,7 +81,7 @@ const INDETERMINATE_ANIMATION_TEMPLATE = `
81
81
host : {
82
82
'role' : 'progressbar' ,
83
83
'class' : 'mat-progress-spinner' ,
84
- '[class._mat-animation-noopable]' : `_animationMode === 'NoopAnimations' ` ,
84
+ '[class._mat-animation-noopable]' : `_noopAnimations ` ,
85
85
'[style.width.px]' : 'diameter' ,
86
86
'[style.height.px]' : 'diameter' ,
87
87
'[attr.aria-valuemin]' : 'mode === "determinate" ? 0 : null' ,
@@ -110,6 +110,9 @@ export class MatProgressSpinner extends _MatProgressSpinnerMixinBase implements
110
110
*/
111
111
private static styleTag : HTMLStyleElement | null = null ;
112
112
113
+ /** Whether the _mat-animation-noopable class should be applied, disabling animations. */
114
+ _noopAnimations : boolean = this . animationMode === 'NoopAnimations' && this . platform . isBrowser ;
115
+
113
116
/** The diameter of the progress spinner (will set width and height of svg). */
114
117
@Input ( )
115
118
get diameter ( ) : number { return this . _diameter ; }
@@ -145,9 +148,9 @@ export class MatProgressSpinner extends _MatProgressSpinnerMixinBase implements
145
148
}
146
149
147
150
constructor ( public _elementRef : ElementRef ,
148
- platform : Platform ,
151
+ public platform : Platform ,
149
152
@Optional ( ) @Inject ( DOCUMENT ) private _document : any ,
150
- @Optional ( ) @Inject ( ANIMATION_MODULE_TYPE ) public _animationMode ?: string ) {
153
+ @Optional ( ) @Inject ( ANIMATION_MODULE_TYPE ) private animationMode ?: string ) {
151
154
152
155
super ( _elementRef ) ;
153
156
this . _fallbackAnimation = platform . EDGE || platform . TRIDENT ;
@@ -236,7 +239,7 @@ export class MatProgressSpinner extends _MatProgressSpinnerMixinBase implements
236
239
'role' : 'progressbar' ,
237
240
'mode' : 'indeterminate' ,
238
241
'class' : 'mat-spinner mat-progress-spinner' ,
239
- '[class._mat-animation-noopable]' : `_animationMode === 'NoopAnimations' ` ,
242
+ '[class._mat-animation-noopable]' : `_noopAnimations ` ,
240
243
'[style.width.px]' : 'diameter' ,
241
244
'[style.height.px]' : 'diameter' ,
242
245
} ,
@@ -249,8 +252,8 @@ export class MatProgressSpinner extends _MatProgressSpinnerMixinBase implements
249
252
export class MatSpinner extends MatProgressSpinner {
250
253
constructor ( elementRef : ElementRef , platform : Platform ,
251
254
@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 ) ;
254
257
this . mode = 'indeterminate' ;
255
258
}
256
259
}
0 commit comments