As a newcomer to Javascript, Typescript, and Angular, I am working on creating my own stats app by fetching data/game stats from a website. To organize the data effectively, I have set up an Interface with specific Key/Value pairs that correspond to the information I want to display in my template.
The response from the API is structured as nested objects, leading me to use Object.keys() for iterating through these objects and presenting the results on my HTML template. While I can successfully display the JSON of the nested object, my issue lies in displaying only the defined key values from my Interface, rather than the entire key/value set.
In an attempt to address this, I tried converting my lifeTimeStat Interface into an object within my HTML loop. Efforts included initializing it as an object within the CombatListComponent, but encountered an error: "TypeError: Cannot read property 'keys' of undefined." The workaround of setting Object = Object
simply displays the entire object structure without adhering to the specific shape outlined in my Interface.
To showcase the selected data according to my Interface definition, I need further assistance with correctly transforming my Interface into an object or finding a better approach for data presentation. I've spent countless hours researching and seeking solutions on various platforms to no avail.