restangular icon indicating copy to clipboard operation
restangular copied to clipboard

customGET and responseInterceptor 'what' argument

Open plong0 opened this issue 9 years ago • 1 comments

Hello, so I have a modularized REST API, and so far Restangular has been amazing at helping with handling caching.

What I am looking at now is a more generic asset loading service function that takes arguments: module, path, params. I am doing something like:

var loader = Restangular.all(module);
var asset = loader.customGET(path, params);

(the actual code is bit more detailed as my service manages the assets to handle caching when the same asset is requested more than once)

This is working to retrieve the data I want, but what is not working is in my responseInterceptor, the what argument is set to path, when I would expect it to be set to module.

Wondering what the solution is? Perhaps I should be using something different than Restangular.all(module); ? As it is a generic (non-specific) asset loader, the path is not always an id, but it will always be an endpoint within a specific module.

plong0 avatar Jun 12 '15 18:06 plong0

+1

This is happening in case of normal 'get' as well. Please check the below plunker. https://plnkr.co/edit/fVG5QYTATFoLuRgv0aVv?p=preview

rguruprakash avatar Mar 15 '17 07:03 rguruprakash