My goal is to import data from an Excel file into my angular application. I have successfully retrieved the data from the Excel file, parsed it to extract the necessary columns, and stored it in an array within my service.ts file.
I call the service from my component.ts file as a return, where I confirm the data retrieval using console.log().
To display the data as a MatTableDataSource in the child component, I am utilizing @Output() to pass the data to the child.
I have tested that the HTML template functions properly by loading the data into a json-server and retrieving it through a service.
Despite several attempts to troubleshoot, the datasource is not displaying on the HTML. Although my HTML screen indicates the presence of records, the actual data rows are not visible.
Console.Log information:
bom-load:
[]
0: {qty: "6", mfg: "Mencom", partNumber: "1321-3R8-C", desc: "480V 3-PHASE AC DRIVE REACTORS, OPEN TYPE, 8A, 3 HP Drive"}
1: {qty: "1", mfg: "AB", partNumber: "1756-EN2T", desc: "1756 CONTROL LOGIX ETHERNET / IP BRIDGE MODULE (128 TCP/IP CONNECTIONS)"}
...
bom-list.component.ts line 43 log output:
bom-list:
MatTableDataSource {_renderData: BehaviorSubject, _filter: BehaviorSubject, ...}
Image of html table trying to use data loaded from Excel
<a href="https://i.sstatic.net/aojbf.png" rel="nofollow noreferrer"></a>
Image of static data using this.getAllBomItems
<a href="https://i.sstatic.net/AmkJa.png" rel="nofollow noreferrer"></a>
Interesting development:
by adding; as suggested; ngOnChanges(), I now get data, but ONLY after clicking the pagination buttons.