I'm trying to get the response of a request using $resource, for example I have:
angular.module('app').factory('AuthResource', ['$resource', function($resource) {
return {
isAuthenticated : function() {
return $resource('/api/v1/auth/authenticated').query();
}
}
}]);
Then in my controller I'm calling this service and doing:
console.log(AuthResource.isAuthenticated());
This doesn't return the actual result, which is simply a single object {'success' : 'true'}.
Instead it returns:
Resource {$resolved: false, $then: function, $get: function, $save: function, $query: function…}
$resolved: true
$then: function (callback, errback) {
success: false
__proto__: Resource
How do I go about getting the actual returned object? I'm not applying this to any models, just using the data to determine some routing.
Thank you!