我需要帮助使用AngularJS ng-repeat将JSON数组索引放入表列中。下面是JSON,我想将其转换为HTML表格:
{
"Employee": [
{
"Name": "`Rocky`",
"Location": "Office"
},
{
"Name": "John",
"Location": "Home"
}
]
}
<table>
<tbody>
<tr>
<td>Rocky</td>
<td>John</td>
</tr>
<tr>
<td>Office</td>
<td>Home</td>
</tr>
</tbody>
</table>
答案 0 :(得分:1)
就这样使用:
SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'your_database_here' AND TABLE_NAME LIKE '%letters_from_your_table_here%' ORDER BY TABLE_NAME DESC
答案 1 :(得分:1)
你可以这样做:
<table>
<tbody>
<tr ng-repeat="list in object.Employee">
<td>{{list.Name}}</td>
<td>{{list.Location}}</td>
</tr>
</tbody>
</table>
答案 2 :(得分:0)
要使用ng-repeat访问数组键,请执行以下操作:
<tr ng-repeat="item in obj.EmpArray">
<td>{{item.Name}}</td>
<td>{{item.Location}}</td>
</tr>