Currently, I am working on an angular web project that involves a main component class loading a Modal to update a report. Within this Modal, there are tabs - one of which is the transaction tab for which I am responsible. However, I have encountered an issue where the transactions tab retains the data it loaded initially even after closing and reopening the update report modal. My goal is to ensure that the transactions tab reloads the data each time the update modal is opened. Below is where I retrieve the data:
enter ngOnInit() {
this.getTransactions();
this.getAllTransmodes();
}code here
This is the method used to fetch the data:
getTransactions(): void {
this.onDeselect();
this.response = this.reportTransactionsTabService.getTransactions(this.selectedReport.xmlGuid)
.subscribe(
items => {
this.transactions = items;
this.filteredTransactions = this.transactions;
this.totalTransactions = this.filteredTransactions.length
this.filterValue = "";
this.currentSortField = null;
},
error => this.errorMessage = <any>error);
}