restangular icon indicating copy to clipboard operation
restangular copied to clipboard

Add a test for nested resources from a `addRestangularMethod` result

Open leahciMic opened this issue 11 years ago • 2 comments

This test identifies an issue I am currently having with addRestangularMethod.

Given the following code.

var Accounts = Restangular.withConfig(function(RestangularConfigurer) {
  RestangularConfigurer.addElementTransformer('users', true, function(worker) {
    worker.addRestangularMethod('doSomething', 'get', 'do-something');
    return worker;
  });
}).service('accounts');

Accounts.doSomething().then(function(doSomething) {
  doSomething.one('foo').get();
});

I would expect doSomething.one('foo').get() to fetch accounts/do-something/foo, and not accounts/foo.

leahciMic avatar Oct 10 '14 04:10 leahciMic

I think this looks good, but I'll have to read over it and review it in more depth before merging. Can you squash the commits into one or two commits please?

daviesgeek avatar Jun 18 '16 00:06 daviesgeek

@daviesgeek it's definitely been a while since I've used this project. I have rebased the commits for you.

leahciMic avatar Jun 21 '16 06:06 leahciMic