Skip to content

Instantly share code, notes, and snippets.

@aurbano
Created April 18, 2015 11:07
Show Gist options
  • Save aurbano/ce4f95e0076763b5e9c6 to your computer and use it in GitHub Desktop.
Save aurbano/ce4f95e0076763b5e9c6 to your computer and use it in GitHub Desktop.
AngularJS returning data from an endpoint as a resource
angular.module('serviceName', [])
.factory('resourceName', ['$resource',
function($resource) {
var status = $resource('/endpoint');
return status.get().$promise;
}
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment