How to disable animations in angular material

kimondoe picture kimondoe · May 17, 2018 · Viewed 16.8k times · Source

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.

Answer

Pardeep Jain picture Pardeep Jain · May 17, 2018

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