在这里,我正在从CustomModalComponent调用delete函数。但是我想将参数传递给删除功能。
我想将数据传递到引用该函数的confirmAction: this.delete
变量
有没有可能?
delete = (data) => {
this.systemAdminSvc.deleteSystemAdmin(data.id).subscribe((res: IHttpResponse) => {
this.handleApiResponse(res);
});
}
openDelete = (data) => {
const modalInput: ICustomModalData = {
header: 'CONFIRMATION',
modalBody: 'Are you sure you want to delete the item ?',
confirmAction: this.delete,
okText: 'Confirm',
cancelText: 'Cancel'
};
this.dialog.open(CustomModalComponent, {
width: '400px',
data: modalInput
});
}