I'm trying to show a JSON code into a table of html. I have this JSON:
posts:[
{
"category":[],
"status":[]
},
{
"category":
[
{
"ID_post":"2",
"category":"5 Reasons",
"ID_cat":"1"
},
{
"ID_post":"2",
"category":"Advertising",
"ID_cat":"2"
}
],
"status":
[
{
"ID_post":"2",
"status":"Approved",
"ID_stat":"1",
"color":"red"
},
{
"ID_post":"2",
"status":"Placed",
"ID_stat":"2",
"color":"#1800fb"
}
]
}
]
I want to show the color of the status into a html table like this:
<tr>
<th>Web Status</th>
</tr>
<tbody ng-repeat="post in posts | startFrom: start | limitTo: limit">
<tr>
<td>{{post.status}}</td>
</tr>
</tbody>
It returns something like this in the second post:
[{"ID_post":"2","status":"Approved","ID_stat":"1","color":"red"},{"ID_post":"2","status":"Placed","ID_stat":"2","color":"#1800fb"}]
But I need the color of each post. How can I get it? I tried with post.status.color but it doesn't work. Can someone help me? Thank you!