I need help parsing two sets of json data from the following URLs: https://raw.githubusercontent.com/openfootball/football.json/master/2015-16/en.1.json https://raw.githubusercontent.com/openfootball/football.json/master/2016-17/en.1.json
My goal is to display this data in an angularjs view using a table format by fetching it through an HTTP service. I am familiar with displaying data from a single URL, but unsure how to handle multiple URLs and display the data together. I've heard about using $q for this, but I'm not sure how to implement it. Can someone please provide guidance? Below is a solution for retrieving data from a single URL.
this.baseUrl = 'some url';
this.loadAllBlogs = function() {
$http({
method: 'GET',
url: main.baseUrl + '/all'
}).then(function successCallback(response) {
// this callback will be called asynchronously
// when the response is available
console.log(response);
main.blogs = response.data.data;
console.log(main.blogs);
}, function errorCallback(response) {
// called asynchronously if an error occurs
// or server returns response with an error status.
alert("some error occurred. Check the console.");
console.log(response);
});
}
Any suggestions on how to handle two URLs simultaneously?