Looking to use Angular to extract a specific value from the following API:
Current code snippet being utilized:
app.controller("api", function($scope, $http) {
$scope.home = "This is the homepage";
$scope.getRequest = function() {
console.log("I've been pressed!");
$http.get("https://ergast.com/api/f1/2013/driverStandings.json").then(
function successCallback(response) {
//$scope.response = response.data;
console.log("response.data.MRData.StandingsTable");
console.log(response.data.MRData.StandingsTable);
console.log("response.data.MRData.StandingsTable.StandingsLists.0.DriverStandings");
console.log(response.data.MRData.StandingsTable.StandingsLists.DriverStandings);
},
function errorCallback(response) {
console.log("Unable to perform get request");
}
);
};
});
Output received from the above code:
https://i.sstatic.net/g0zPU.png
Struggling with how to handle the '0' value in the response and access the DriverStandings array within the API.