mgonto / restangular

AngularJS service to handle Rest API Restful Resources properly and easily
MIT License
7.87k stars 840 forks source link

Use custom methods with decoupled service #1163

Open gkpo opened 9 years ago

gkpo commented 9 years ago

I'm using a Decoupled Restangular service for consuming my API:

// Declare factory
module.factory('Users', function(Restangular) {
  return Restangular.service('users');
});

I'd like to call a custom method on my resource: /users/active The documentation says I can do it like so:

// GET /users/active
Restangular.all("users").customGET("active")

However, I'd like to use the service I created before, rather than redeclaring a restangular resource 'users', which wouldn't be completely "DRY".

I'd like to do something like:

Users.customGET("active")

But I get an error TypeError: Clientfile.customGET is not a function.

fracz commented 9 years ago

+1

yasar commented 8 years ago

+1

freshsun commented 7 years ago

+1

stefanosalvucci commented 7 years ago

+1