mat-dialog panel closes immediately code example
Example 1: mat dialog disable close
this.dialog.open(DialogComponent, { disableClose: true });
Example 2: close mat dialog from component
@Component({/* ... */})
export class YourDialog {
constructor(public dialogRef: MatDialogRef<YourDialog>) { }
closeDialog() {
this.dialogRef.close('Pizza!');
}
}