我有这项服务:
footballdataAPI.getTeam = function(id) {
$http.defaults.headers.common['X-Auth-Token'] = '613a6b6937394ae8a94d69f358f76902';
return $http.get('http://www.football-data.org/alpha/soccerseasons/398/fixtures?matchday=5?callback=JSON_CALLBACK');
};
但是我想在这里专门更新其他服务的数据时更新matchday的参数,即抓住这个json回调中的matchday并自动在其他服务中使用它。不确定如何去做,有什么想法吗?
服务
footballdataAPI.getTeams = function() {
$http.defaults.headers.common['X-Auth-Token'] = '613a6b6937394ae8a94d69f358f76902';
return $http.get('http://www.football-data.org/alpha/soccerseasons/398/leagueTable?callback=JSON_CALLBACK');
};
CONTROLLER
.controller('teamsController', function($scope, footballdataAPIservice) {
$scope.teamsList = [];
});
HTML
<h2 class="secondary-title">Matchday {{teamsList.matchday}}</h2>