Angular Material: How to close all mat-dialogs and sweet-alerts on logout
This is what i have done to close any open mat-dialog throughout the application: import {MatDialog} from ‘@angular/material’; export class myClass { constructor(private dialogRef: MatDialog) { } logOut() { this.dialogRef.closeAll(); } } If you would like to close only a specific dialog you can loop through dialogRef.openDialogs and close the respective dialog using close() This … Read more