angularangular-material-5

How to disable animations in angular material


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.


Solution

  • 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; }