如何在 angular 9 中使用 Angular 材料制作持久对话框(模态框)?

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

有人能告诉我如何使 angular material 对话框持久化吗?所谓持久化,我的意思是当用户在对话框外单击时对话框不应该消失。提前致谢!!!

要创建模式对话框,请在打开对话框时使用 disableClose 属性。将其设置为真。这是一个例子。

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