How do I get the league titles from the given JSON to show in [TITLE]? Everything else works just fine, but I would like for it to show up in league categories.
My HTML:
<div ng-controller="LeaguesCtrl">
<div ng-repeat="league in leagues">
League: {{[TITLE]}}
<table>
<tr ng-repeat="match in league">
<td>{{match.home_team}}</td>
<td>-</td>
<td>{{match.away_team}}</td>
<td><a href="#">{{match.home_odds}}</a></td>
<td><a href="#">{{match.draw_odds}}</a></td>
<td><a href="#">{{match.away_odds}}</a></td>
</tr>
</table>
<br />
</div>
</div>
My JSON:
{
"UEFA Champions League": [
{
"id": 152494,
"home_team": "APOEL Nicosia",
"home_short": "",
"away_team": "Paris SG",
"away_short": ""
},
{
"id": 152519,
"home_team": "Chelsea",
"home_short": "",
"away_team": "Maribor",
"away_short": ""
}
],
"Barclays Premier League": [
{
"id": 126938,
"home_team": "Arsenal",
"home_short": "",
"away_team": "Hull",
"away_short": ""
},
{
"id": 126942,
"home_team": "Manchester C",
"home_short": "Man C",
"away_team": "Tottenham",
"away_short": "Man C"
}
]
}
My AngularJS controller:
myApp("LeaguesCtrl", function($scope, $http) {
$http.get('http://api.odds24.com/best-odds?user=dev&leagues=SOCENGPRE,SOCINTCHL,SOCESPPRI').
success(function(data, status, headers, config) {
$scope.leagues = data;
});
});