I'm trying to return a JSON object from a call to a slim PHP function. It returns the object like this:
if (count > 0) {
echo json_encode(array("status" => "greater"));
} else {
echo json_encode(array("status" => "lesser"));
}
In my javascript
I call this slim function
using a service:
$scope.statusResults = service.isGreater();
console.log($scope.statusResults);
but what I get back in the console is: e {$$state: Object}
If I drill down into e, I find $$state : Object
which I can drill down into to get: status:1 value:Object
and one last time to finally get to status:"greater"
I have no idea what $$state
is or why it returns this way. I wanted it to return as a simple JSON object
and just be {status: "greater"}
. Is there a way to get it to return like that? If not, how do I access status?
Thanks!