Search code examples
angularangular-materialmat-dialog

Add a universal property to the MatDialog


I want to add the property disableClose with the value true to all MatDialogs in my Angular app.

I've searched already and tried to set the property disableClose in the app.module.ts file. But that didn't work.

Anyone have an idea?


Solution

  • You can make a custom component that is a clone of MatDialog, but uses MatDialog with the property disableClose as default.