Skip to content

Commit fc14e77

Browse files
authored
Revert "fix(material/dialog): use custom token to disable animations (#31156)" (#31181)
This reverts commit af04c77.
1 parent 306eef1 commit fc14e77

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

src/material/dialog/testing/dialog-opener.ts

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import {
1717
inject,
1818
} from '@angular/core';
1919
import {MatDialog, MatDialogConfig, MatDialogModule, MatDialogRef} from '../../dialog';
20+
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
2021
import {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
})
9587
export class MatTestDialogOpenerModule {}

0 commit comments

Comments
 (0)