I\'m terrible at javascript and very new to Angular so do bear with me.
My server is returning this:
{\"latitude\": 3.172398, \"name\": \"Event\", \"
From the docs:
It is important to realize that invoking a $resource object method immediately returns an empty reference (object or array depending on isArray). Once the data is returned from the server the existing reference is populated with the actual data.
So your logging wont work unless you put it in a callback function, like this:
function mapCtrl($scope, Event) {
Event.get({eventId: $scope.eventId},function(eventDetail){
//on success callback function
console.log(eventDetail);
console.log(eventDetail.latitude);
});
}
If you for some reason don't want to work with a resource
you can use the $http service:
$http.get(url).then(function(response){console.log(response.data);});