I have a transaction.component.html file that displays the app-deal-partners component. Every time the delete function is triggered, I want to refresh and reload the child component, which is the app-deal-partners component.
I need to reload
<app-deal-partners [transaction]="transaction" [forApprovalResponse]="forApprovalResponse"></app-deal-partners>
How can we achieve this in Angular? Thank you.
#transaction component ts code
delete(rowData: any) {
this.isLoading = true;
this.Service.delete(rowData.id)
.pipe(finalize(() => { this.isLoading = false;}))
.subscribe({
next: (res) => {
},
error: (err) => {
this.notificationService.showError('Something went wrong, Try again later.');
this.isLoading = false;
},
complete: () => {
this.isLoading = false;
},
});
}
#transaction.component.html code rendering app-deal-partners code
<div style="padding-bottom: 20px;">
<app-deal-partners [transaction]="transaction" [forApprovalResponse]="forApprovalResponse"></app-deal-partners>
</div>
#app-deal-partners HTML code
<app-table-multi-sort (dataServiceEvent)="dataServiceEvent($event)" [tableOptions]="tableOptions" [tableData]="data" (tableActionsEvent)="tableActions($event);" (editRowEvent)="editDeal($event)"></app-table-multi-sort>