I am trying to loop through some json values outside the actual function. could anyone help me?
app.controller('MapCtrl', function($scope, $http){
$scope.contents = [];
$http.get('/data4estate/data_model.php')
.success(function(data) {
$scope.contents = data;
});
for (i = 0; i < $scope.contents.length; i++) {
console.log( $scope.contents[i].name);
}
});