I need help in getting JSON array index into table columns using AngularJS ng-repeat. Below is the JSON and I want to convert it to a HTML table:
{
"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>
You can do it this way:
<table>
<tbody>
<tr ng-repeat="list in object.Employee">
<td>{{list.Name}}</td>
<td>{{list.Location}}</td>
</tr>
</tbody>
</table>