Open gkpo opened 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:
/users/active
// 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.
+1
I'm using a Decoupled Restangular service for consuming my API:
I'd like to call a custom method on my resource:
/users/active
The documentation says I can do it like so: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:
But I get an error TypeError: Clientfile.customGET is not a function.