-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Extended customizability of $resource #1045
Conversation
+1 for this |
+1 |
Thanks for your contribution! In order for us to be able to accept it, we ask you to sign our CLA (contributor's license agreement). CLA is important for us to be able to avoid legal troubles down the road. For individuals (a simple click-through form): For corporations (print, sign and scan+email, fax or mail): |
ok, submitted the form 👏 |
Is this in yet? |
ahall, this is not in yet, but you can duplicate the parse.com functionality, using the current release, just by changing |
@ajoslin, nice contribution. Very nice. I have use for this in an upcoming project and I was a little concerned about how I'd implement it. |
+2! |
re: parseResponse - would love your thoughts on https://groups.google.com/forum/?fromgroups=#!topic/angular/Y862h6N9Sxc |
Hi @ajoslin :-) There was a similar issue opened quite some time ago (#736) to support custom headers for resources. This issue was closed from the commit 9b5656e. From what I can see yours is more flexible as it allows to pass in the whole httpConfig object and not only headers. On top of this it supports this custom In any case it can't be merged like this, it would have to be rebased and you would have to decide how to deal with the existing header-adding functionality. On top of rebasing you would have to add / modify docs. Commit message would have to be amended as well to follow the https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit# I hope that you are still motivated to work on this one :-) |
+1! |
+1 |
1 similar comment
+1 |
I would suggest change calling |
In the current state the PR can not be merged do to:
I think the way to go forward is to copy all of the $http.config properties from the resource definition to $http.config
This would make it consistent with the previous feature set, and be consistent with all of the existing API. I am closing the issue for now. If you make the changes please reopen it and we will look at it again. Thanks in advance. |
For those who wonder (or come here from googling), this landed in af89daf (since 1.1.2) |
Is it possible to set dynamic headers per $resource.action request call yet? |
Added an option to $resource's
action
parameters. The user can define a custom httpConfig and a custom parseResponse function. These allow the user to work with a lot more systems (sending custom headers through action.httpConfig and parsing weird responses with parseResponse).Example use case. these additions let me use www.parse.com and $resource together easily.
I don't know if action.httpConfig and action.parseResponse are the best names, but I think the idea of adding these two simple things adds a lot more flexibility to $resource.