【发布时间】:2017-02-14 03:13:34
【问题描述】:
谁能帮助我使用 Angular JS Ng-Repeat 为 JSON 提供 HTML 表格(请参阅下面的 HTML 表格格式)
假设 Angular JS 从文件中获取 JSON 并且 Object 将是 PersonEvents
所以我将在 AngulaJS 视图中的 PersonEvents 中使用列表
JSON
{
"PersonEvent": {
"Body": {
"Persons": {
"CurrentPersons": {
"Service": [
{
"-PersonID": "TS029",
"PersonChangeActivity": "NoChange",
"Define": {
"PersonPCProduct": {
"-pn": "8000065"
}
}
},
{
"-PersonID": "TS023",
"PersonChangeActivity": "NoChange",
"Define": {
"PersonPCProduct": {
"-pn": "8000005",
"Business": "Voice"
}
}
}
]
},
"PersonChanges": {
"PersonInstalls": {
"Service": [
{
"-PersonID": "OT446",
"PersonChangeActivity": "Install",
"Define": {
"PersonPCProduct": {
"-pn": "2411",
"Business": "Video"
}
}
},
{
"-PersonID": "VD034",
"PersonChangeActivity": "Install",
"Define": {
"PersonPCProduct": {
"-pn": "2552",
"Business": "Video"
}
}
}
]
},
"PersonDisconnects": {
"Service": [
{
"-PersonID": "VD034",
"PersonChangeActivity": "Disconnect",
"Define": {
"PersonPCProduct": {
"-pn": "2552",
"Business": "Video"
}
}
},
{
"-PersonID": "VP087",
"PersonChangeActivity": "Disconnect",
"Define": {
"PersonPCProduct": {
"-pn": "10400024",
"Business": "Video"
}
}
}
]
}
}
}
}
}
}
预期的 HTML 表格
<table>
<tr>
<th>Current Persons<br></th>
<th>PersonInstalls</th>
<th>PersonDisconnects</th>
</tr>
<tr>
<td>TS029,NoChange,8000065<br>TS023,NoChange,8000005</td>
<td>OT446,Install,2411<br>VD034,Install,2552</td>
<td>VD034,Disconnect,2552<br>VP087,Disconnect,10400024</td>
</tr>
</table>
【问题讨论】:
标签: angularjs json html-table ng-repeat