Looking for some guidance with Angular as I am just starting out. I am currently trying to send an API request in angular 6 using Typescript. However, I am facing difficulties when it comes to adding data to a table.
Check out my code on: Codepen
In my project, there is an angular material table that includes a custom interface called PeriodicElement
, an array named
const ELEMENT_DATA: PeriodicElement[]
, and a component class.
I am struggling to figure out how to append new data to the ELEMENT_DATA
array from within the class due to its placement outside of the class scope.
If anyone has experience with this issue and can offer assistance, I would greatly appreciate it!