@@ -17,8 +17,8 @@ import {
1717 inject ,
1818} from '@angular/core' ;
1919import { MatDialog , MatDialogConfig , MatDialogModule , MatDialogRef } from '../../dialog' ;
20+ import { NoopAnimationsModule } from '@angular/platform-browser/animations' ;
2021import { Subscription } from 'rxjs' ;
21- import { AnimationsConfig , MATERIAL_ANIMATIONS } from '@angular/material/core' ;
2222
2323/** Test component that immediately opens a dialog when bootstrapped. */
2424@Component ( {
@@ -63,12 +63,12 @@ export class MatTestDialogOpener<T = unknown, R = unknown> implements OnDestroy
6363 throw new Error ( `MatTestDialogOpener does not have a component provided.` ) ;
6464 }
6565
66- this . dialogRef = this . _ngZone . run ( ( ) => {
67- const config = { ... ( MatTestDialogOpener . config || { } ) } ;
68- config . enterAnimationDuration = 0 ;
69- config . exitAnimationDuration = 0 ;
70- return this . dialog . open < T , R > ( MatTestDialogOpener . component as ComponentType < T > , config ) ;
71- } ) ;
66+ this . dialogRef = this . _ngZone . run ( ( ) =>
67+ this . dialog . open < T , R > (
68+ MatTestDialogOpener . component as ComponentType < T > ,
69+ MatTestDialogOpener . config || { } ,
70+ ) ,
71+ ) ;
7272 this . _afterClosedSubscription = this . dialogRef . afterClosed ( ) . subscribe ( result => {
7373 this . closedResult = result ;
7474 } ) ;
@@ -82,14 +82,6 @@ export class MatTestDialogOpener<T = unknown, R = unknown> implements OnDestroy
8282}
8383
8484@NgModule ( {
85- imports : [ MatDialogModule , MatTestDialogOpener ] ,
86- providers : [
87- {
88- provide : MATERIAL_ANIMATIONS ,
89- useValue : {
90- animationsDisabled : true ,
91- } as AnimationsConfig ,
92- } ,
93- ] ,
85+ imports : [ MatDialogModule , NoopAnimationsModule , MatTestDialogOpener ] ,
9486} )
9587export class MatTestDialogOpenerModule { }
0 commit comments