I am trying to display a table by looping an array of objects fetched from backend API.
<tr *ngFor="let obj of objarray">
<td>{{obj.property1}}</td>
<td>{{obj.property2}}</td>
<td> {{**updated value of property 2 fetched from API using value obj.property1 as query parameter** }}
</tr>
I have tried to use a function call for getting updated value at the third column, but it kept on looping as the page kept on loading.
Then, I tried to use set property to update the value in component.ts, but due to async nature of the third part API call to fetch the current status, I am getting undefined value.
A:
looping object obj [ i to obj.length]
obj[i].property3 = getUpdatedValuefromAPI(obj[i].property1);
B:
getUpdatedValuefromAPI(property1)
{
// fetch api call and return value-
}
Now due to Async nature of the call, eventhough I am able to fetch updated value from API, the setproperty always sets value undefined and the third column is displayed as empty in front end.
Could someone point the error. How do I update the the last column of a multi row table dynamically from another api call?