Skip to content

Instantly share code, notes, and snippets.

@rmcauley
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rmcauley/5e462ee589d16df18214 to your computer and use it in GitHub Desktop.
Save rmcauley/5e462ee589d16df18214 to your computer and use it in GitHub Desktop.
ngApp.factory("someResource", function($resource) {
var res = $resource("/some/url/:id", { id: '@id' });
res.prototype.blerch = function() { console.log(this.id); };
// possibility 1
res.attr1 = "hello";
return res;
});
var someResourceResolve = function($resource, $stateParams, someResource) {
return new someResource({ 'id': $stateParams.id }).$get();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment