问题
I have used angular material version: 5.2.1
And wanted to know how to disable their animations, especially the matDialog.
I have tried @.disabled but no luck.
回答1:
You can use NoopAnimationsModule
by angular material
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
@NgModule({
...
imports: [NoopAnimationsModule],
...
})
export class PizzaPartyAppModule { }
Or if you want to remove transition on some specific components you can do it via CSS like this
.mat-dialog{ transition: none; }
来源:https://stackoverflow.com/questions/50385136/how-to-disable-animations-in-angular-material