我有多个对话框组件,需要根据documentType打开。有没有一种方法可以将组件暂停到以下方法。这样做的最好方法是什么。我可以使用数十条if..else语句来做到这一点,但这似乎不是正确的方法。
previewDialog(pdfCase, party, documentType) {
this.dialogRef = this.dialog.open(DOCT030DialogComponent, {
//on the basis of documentType I need to open different components
panelClass: 'mail-compose-dialog',
data: {
case: pdfCase,
party: party,
documentType: documentType
}
});
this.dialogRef.afterClosed()
.subscribe(response => {
if (!response) {
return;
}
const actionType: string = response[0];
switch (actionType) {
/**
* Send
*/
case 'send':
break;
/**
* Delete
*/
case 'delete':
//this.caseService.getVisits(this.caseId);
break;
}
});
}