@@ -17,8 +17,8 @@ import {
17
17
inject ,
18
18
} from '@angular/core' ;
19
19
import { MatDialog , MatDialogConfig , MatDialogModule , MatDialogRef } from '../../dialog' ;
20
+ import { NoopAnimationsModule } from '@angular/platform-browser/animations' ;
20
21
import { Subscription } from 'rxjs' ;
21
- import { AnimationsConfig , MATERIAL_ANIMATIONS } from '@angular/material/core' ;
22
22
23
23
/** Test component that immediately opens a dialog when bootstrapped. */
24
24
@Component ( {
@@ -63,12 +63,12 @@ export class MatTestDialogOpener<T = unknown, R = unknown> implements OnDestroy
63
63
throw new Error ( `MatTestDialogOpener does not have a component provided.` ) ;
64
64
}
65
65
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
+ ) ;
72
72
this . _afterClosedSubscription = this . dialogRef . afterClosed ( ) . subscribe ( result => {
73
73
this . closedResult = result ;
74
74
} ) ;
@@ -82,14 +82,6 @@ export class MatTestDialogOpener<T = unknown, R = unknown> implements OnDestroy
82
82
}
83
83
84
84
@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 ] ,
94
86
} )
95
87
export class MatTestDialogOpenerModule { }
0 commit comments