我本地寫了個json檔叫demo.js,然後我想ng-repeat裡面的資料。現在遇到的問題是:
我不知道怎麼循環出roles的資料。
{
"demoData": [
{
"dp": "aaa1",
"name": "用户名1",
"number": "11111",
"score": "22222",
"salary": "11111",
"jobs": "scripts",
"roles": [
{
"new": "bbb",
"edit": "ddd",
"ccc": "aaaa",
"del": "dddd"
}
],
"other": "备注",
"action": "删除"
},
{
"dp": "bbb",
"name": "用户名1",
"number": "11111",
"score": "22222",
"salary": "11111",
"jobs": "scripts",
"roles": [
{
"new": "bbb",
"edit": "ddd",
"ccc": "aaaa",
"del": "dddd"
}
],
"other": "备注",
"action": "删除"
}
]
}
習慣沉默2017-05-15 17:16:10
巢狀循環
<p ng-repeat="item in demoData">
<p ng-repeat="item2 in item.roles">
{{item2}}
</p>
</p>