I have a configuration like the following in the component file :
public status: any = {
PRG: "In Progress",
COMP: "Completed",
FAIL: "Failed",
};
Now in the template file I have a loop and in there, the status is coming as one of the field. I am trying to access value from status
like the following:
<tr *ngFor="let item of items">
<td>{{ config[item.status] }}</td>
</tr>
But I am not getting any value here. How to access the value from JSON object ?
UPDATE: My items
looks like the following:
[
{
"id":3,
"description":"Description",
"status":"COMP",
"user_id":"user2"
},
{
"id":4,
"description":"Description",
"status":"INPRG",
"user_id":"user2"
}
]
and the HTML looks like the following :
<div class="d-flex arm-release_status badge{{configurations[item.status]}}">
<p>{{status[item.status]}}</p>
</div>
{{status[release.release_status]}}