我想显示一个JSON代码到一个HTML表格。我有这样的JSON:我如何显示在HTML角度嵌套的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"
}
]
}
]
我想说明的状态的颜色为HTML表是这样的:
<tr>
<th>Web Status</th>
</tr>
<tbody ng-repeat="post in posts | startFrom: start | limitTo: limit">
<tr>
<td>{{post.status}}</td>
</tr>
</tbody>
它返回的东西像这样在第二篇文章中:
[{"ID_post":"2","status":"Approved","ID_stat":"1","color":"red"},{"ID_post":"2","status":"Placed","ID_stat":"2","color":"#1800fb"}]
但我需要每个岗位的颜色。我怎么才能得到它?我试着用post.status.color,但它不起作用。 有人可以帮我吗? 谢谢!