Q:

How to make a persistent dialog (modal box) using Angular materials in angular 9?

Can someone tell me how to make angular material dialog persistent?By persistent,i mean the dialog should not disappear when the user click outside of it .thanks in advance!!!

A:

To create a modal dialog, use the disableClose property when opening the dialog.  Set it to true.   Here is an example.
  private openSigninDialog(cb: CallableFunction): void {
    const dialogRef = this.dialog.open(SigninDesktopDialogComponent, {
      width: '400px',
      height: '550px',
      disableClose: true,
      hasBackdrop: true
    });

    dialogRef.afterClosed()
    .pipe(untilComponentDestroyed(this))
    .subscribe(result => {
        cb(result);
    });
  }

