How to loop through and display objects from an HTTP array of objects ?




Asked on September 09, 2019
Hi,

I'm struggling to display specific objects from an array of objects in a table. My JSON (on http) looks like this:
[{"treshold":[{"treshold":35,"pointsToAdd":10},{"treshold":50,"pointsToAdd":20},{"treshold":75,"pointsToAdd":30},{"treshold":100,"pointsToAdd":40}],"_id":"5d6f3acd4d94a08064f4bd11","is_active":true,"date":"20190904"}]

I want to display, in two separate columns, values of "treshold" and "pointsToAdd". Currently, all I am extracting is displayed in one column (instead of two) as:
[object Object],[object Object],[object Object],[object Object]

My component .ts file:
app.component.ts
My component .html file:
app.component.html



Replied on September 09, 2019
app.component.html
app.component.ts



Write Answer











©2024 concretepage.com | Privacy Policy | Contact Us