I'm trying to get a URL from a nested JSON object, but am having trouble getting the data. I'm not sure how to get data out of a JSON object that's nested deeply.
app.controller('mainCtrl', function($scope, $http) {
$http.get("https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20json%20where%20url%3D'www.whitehouse.gov%2Ffacts%2Fjson%2Fall%2Fcollege%2520affordability'&format=json&diagnostics=true").then(function(responce) {
$scope.status = responce;
$scope.sortData = responce.data.query.results.json.json.url;
console.log(responce);
console.log($scope.sortData);
});
});
I can console log the object, but I don't know how to get the URL from the deeply nested object. Here's the JSFiddle where the object is console logged. Thanks for the help.