Consider the following JSON structure: UPDATED:
[
{
"game0001": {
"-JfuVKIsUBH27DMJfWmL": {
"action": "STARTFIRSTHALF",
"team": "HOME"
},
"-JfuVLJGMgclLZ0Maduh": {
"action": "GOAL",
"team": "AWAY"
}
},
"$id": "events",
"$priority": null
},
{
"game0001": {
"gameRunning": false,
"startDate": "17/01/2015 17:27:42 PM"
},
"game0002": {
"gameRunning": true,
"startDate": "17/01/2015 19:45:59 PM"
},
"game0003": {
"gameRunning": false,
"scheduledDate": "17/01/2014 12:30:00 PM"
},
"$id": "games",
"$priority": null
}
]
How can I achieve filtering in AngularJS in HTML? In a very basic way, what I'm trying to achieve is the following:
<div ng-repeat="game in games">
<div ng-repeat="event in events | filter:game">
{{event.name}} - {{game.name}}
</div>
</div>
I have 2 maps games and events which share the same keys, e.g (game0001, game0002)
While repeating the games, I would like to have a inner repeater for events and filter only the ones sharing the same key/id.