I've successfully returned a json object which has query results from database. I'm unable to access the returned json one by one.
Here's what the console.log
shows:
Angular code:
$scope.peopleList=[];
$http.get("http://localhost/project/public/people_names").then(function(response) {
$scope.peopleList.push(response.data);
});
console.log($scope.peopleList);
if I use console.log($scope.peopleList[0]);
, it says undefined
. How do I access it to print it using ng-repeat