@@ -20,12 +20,15 @@ import {
2020 ComponentRef ,
2121 ElementRef ,
2222 EmbeddedViewRef ,
23+ Inject ,
2324 NgZone ,
2425 OnDestroy ,
26+ Optional ,
2527 ViewChild ,
2628 ViewEncapsulation
2729} from '@angular/core' ;
2830import { MatSnackBarConfig , _SnackBarContainer } from '@angular/material/snack-bar' ;
31+ import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations' ;
2932import { MDCSnackbarAdapter , MDCSnackbarFoundation } from '@material/snackbar' ;
3033import { Platform } from '@angular/cdk/platform' ;
3134import { Observable , Subject } from 'rxjs' ;
@@ -57,6 +60,7 @@ const MDC_SNACKBAR_LABEL_CLASS = 'mdc-snackbar__label';
5760 // been dismissed and will soon be removed from the DOM. This is used by the snackbar
5861 // test harness.
5962 '[attr.mat-exit]' : `_exiting ? '' : null` ,
63+ '[class._mat-animation-noopable]' : `_animationMode === 'NoopAnimations'` ,
6064 }
6165} )
6266export class MatSnackBarContainer extends BasePortalOutlet
@@ -114,7 +118,8 @@ export class MatSnackBarContainer extends BasePortalOutlet
114118 private _elementRef : ElementRef < HTMLElement > ,
115119 public snackBarConfig : MatSnackBarConfig ,
116120 private _platform : Platform ,
117- private _ngZone : NgZone ) {
121+ private _ngZone : NgZone ,
122+ @Optional ( ) @Inject ( ANIMATION_MODULE_TYPE ) public _animationMode ?: string ) {
118123 super ( ) ;
119124
120125 // Use aria-live rather than a live role like 'alert' or 'status'
0 commit comments