我有一个以下对话框组件(我在另一个组件中使用dialog.open(MyDialogComponent)打开).
export class MyDialogComponent implements OnInit { constructor(public matDialogRef: MatDialogRef<MyDialogComponent>) {} ngOnInit() {} }@H_403_2@我知道我可以通过执行绑定到对话框组件中按钮的matDialogRef.close(dataToReturn)将任何数据返回给调用组件.但是,如果用户点击其他地方但弹出窗口关闭它,我怎么能返回数据呢?