我正在AngularJS中的一个项目。
我有JSON作为
{
"leagues":{
"aLeague":{
"country":"aCountry",
"matchs":{
"aUniqueID1":{
"date":"2014-09-07 13:00:00",
"guest_player":"Me",
"host_player":"Tom",
"odds":{
"guest":"2.80",
"host":"2.25",
"null":"2.85"
},
"score":"0 - 0"
},
"aUniqueID2":{
"date":"2014-09-07 18:30:00",
"guest_player":"Bryan",
"host_player":"Me",
"odds":{
"guest":"3.25",
"host":"1.98",
"null":"2.95"
},
"score":"0 - 0"
}
}
}
}
}
我想在
guest_player
中显示host_player
和ng-repeat
。但是我无法访问
aUniqueID1
或aUniqueID2
。有任何想法吗?
最佳答案
请在这里查看:http://jsbin.com/wekow/1/edit
<p ng-repeat="(key, item) in data.leagues.aLeague.matchs">
Guest Player :{{item.guest_player}}<br/>
Host Player :{{item.host_player}}
</p>
关于javascript - 在AngularJS中访问多维字典,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/25632562/