问题描述
@H_502_0@我正在使用Angular Material对话框,想知道在关闭组件后是否需要销毁它。
示例
openUpdateStatusDialog(alertId: string): void {
this.dialog.open(UpdateStatusDialogComponent,{
data: alertId,panelClass: 'ion-dialog'
}).afterClosed()
.pipe(
map((result) => {
if (result) {
this.updateNotificationStatus.emit(result);
}
}),untilDestroyed(this))
.subscribe();
}
解决方法
AngularMaterial Dialog组件在关闭后不需要手动销毁。
看看官方的Angular材质Dialog Examples。