-
Notifications
You must be signed in to change notification settings - Fork 27.3k
Add possibility to override URL in custom $resource actions #1890
Add possibility to override URL in custom $resource actions #1890
Conversation
Add the ability to override the URL used in $resource custom actions.
Add test for URL overriding in $resource actions.
I would really like to see this happen as it is impossible to work with some rest services at the moment without creating several resources. I note that the pull request conflicts with master now, I have fixed it on my branch, shall I submit another pull request? |
Same here... It's nice to have the resource with one URI and default CRUD but if you want to push it a little further it gets annoying. Would love to have this functionality also... |
@BrynCooke I'm trying to use your fork and I have a question. Does the binding between the url parameters and the object properties work? return $resource( '', {},
{
get: { method:'GET', isArray: true, url:'user/:userId'},
} and I call it like myResource.get({userId:1}), looking at charles I see the request being Cheers, |
@BrynCooke Cheers |
Kindof hijacking the discussion here but done a PR (#2054) to address the above issue (heavily base on @BrynCooke code). |
@zeflasher I guess you meant @guillaume86's code ;-) I'm going to close this PR as #2054 is more generic and handles this use case as well. Thanks @guillaume86 for your contribution! |
Ooops, my bad... Indeed Guillaume86's code... |
No problem |
¡this is great! ¡must be in the next release! 👍 :) |
Hi, |
It'd be sweet(er) if we could prefix the url with a magic token that prepends the resource base url to the new url so it doesn't need to be typed out over and over. So
might become
Not sure if it matters that :id would be prepended. I think as long as there was no |
This change adds the possibility to overridde the template URL when creating $resource custom actions: