@@ -20,12 +20,15 @@ import {
20
20
ComponentRef ,
21
21
ElementRef ,
22
22
EmbeddedViewRef ,
23
+ Inject ,
23
24
NgZone ,
24
25
OnDestroy ,
26
+ Optional ,
25
27
ViewChild ,
26
28
ViewEncapsulation
27
29
} from '@angular/core' ;
28
30
import { MatSnackBarConfig , _SnackBarContainer } from '@angular/material/snack-bar' ;
31
+ import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations' ;
29
32
import { MDCSnackbarAdapter , MDCSnackbarFoundation } from '@material/snackbar' ;
30
33
import { Platform } from '@angular/cdk/platform' ;
31
34
import { Observable , Subject } from 'rxjs' ;
@@ -57,6 +60,7 @@ const MDC_SNACKBAR_LABEL_CLASS = 'mdc-snackbar__label';
57
60
// been dismissed and will soon be removed from the DOM. This is used by the snackbar
58
61
// test harness.
59
62
'[attr.mat-exit]' : `_exiting ? '' : null` ,
63
+ '[class._mat-animation-noopable]' : `_animationMode === 'NoopAnimations'` ,
60
64
}
61
65
} )
62
66
export class MatSnackBarContainer extends BasePortalOutlet
@@ -114,7 +118,8 @@ export class MatSnackBarContainer extends BasePortalOutlet
114
118
private _elementRef : ElementRef < HTMLElement > ,
115
119
public snackBarConfig : MatSnackBarConfig ,
116
120
private _platform : Platform ,
117
- private _ngZone : NgZone ) {
121
+ private _ngZone : NgZone ,
122
+ @Optional ( ) @Inject ( ANIMATION_MODULE_TYPE ) public _animationMode ?: string ) {
118
123
super ( ) ;
119
124
120
125
// Use aria-live rather than a live role like 'alert' or 'status'
0 commit comments