Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Dynamic default params for $resource #1113

Closed
wants to merge 1 commit into from
Closed

Conversation

lascap
Copy link
Contributor

@lascap lascap commented Jul 4, 2012

As discussed in an email thread, here is a pull request to get dynamic default parameters for $resource so it's possible to do:

var User = $resource('/user', {'group': function() { return $location.search().group; }});

....
//modify group in $location
....

// the group is fetched only when I request for the user
user = User.get({'userId': myId}, function() { .... });

@mhevery
Copy link
Contributor

mhevery commented Sep 5, 2012

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):
http://code.google.com/legal/individual-cla-v1.0.html

For corporations (print, sign and scan+email, fax or mail):
http://code.google.com/legal/corporate-cla-v1.0.html

@mhevery
Copy link
Contributor

mhevery commented Sep 12, 2012

ping??? we need the CLA signed, otherwise we can not merge this in.

@lascap
Copy link
Contributor Author

lascap commented Sep 12, 2012

I filled the form, few hours after your email.
Let me try it again.

P

2012/9/12 Miško Hevery notifications@github.com

ping??? we need the CLA signed, otherwise we can not merge this in.


Reply to this email directly or view it on GitHubhttps://github.com//pull/1113#issuecomment-8477652.

@marknadig
Copy link
Contributor

any progress on this? thanks.

@lascap
Copy link
Contributor Author

lascap commented Oct 24, 2012

Hi,
I've electronically signed a CLA few hours after the first post, then resigned it a month ago (after the ping). I just did it again.
The message I got was "Thank you. Your CLA submission will be processed shortly.".
BTW I work for Google and provided the patch during my working hours for business purposes so I'm not even sure a CLA is required. If there is a way to see what happened to my various signed CLAs (were they blocked? rejected? dropped?), I could investigate. Otherwise I cannot do much more...

@pkozlowski-opensource
Copy link
Member

@lascap could you link to the mentioned e-mail thread for the reference? While the fix is easy enough I'm curious about your use case for this one, would love to learn more.

@lascap
Copy link
Contributor Author

lascap commented Nov 8, 2012

Hi Pawel, the initial thread was on private email: here's the main part

I'd like to use $resource but with dynamic default params:

var User = $resource('/user', {'group': function() { return $groupService.currentGroup(); }});

....
//modify group in $groupService
....

// so the group is fetched only when I request for the user
user = User.get({'userId': myId}, function() { .... });

@IgorMinar
Copy link
Contributor

LGTM

@IgorMinar
Copy link
Contributor

I rewrote the tests, added docs and landed this as f57f27d

@IgorMinar IgorMinar closed this Nov 28, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants