What will be the proper way to access the nested elements of this json file in angular?
Using $http in controller
$http.get('app/api.json')
.success(function(data){
$scope.feeds = data;
});
api.json
{
"feed": {
"data": [{
"story": "test story",
"updated_time": "2016-06-05T17:17:49+0000",
"id": "1"
}, {
"message": "jkhkjhkhjlkhk",
"updated_time": "2015-05-08T07:23:14+0000",
"id": "2"
}
],
}
}
the view
<div ng-repeat="feed in feeds">{{feed.data.id}}</div>
Right now I am more concerned with accessing the id's which are common, I see trouble when coming to display the story or messages field since they are different.
PS: I am getting info from a facebook group through the graph api