Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$resource parameter object with array values cannot be passed to server #12115

Closed
xforceco opened this issue Jun 15, 2015 · 2 comments
Closed

$resource parameter object with array values cannot be passed to server #12115

xforceco opened this issue Jun 15, 2015 · 2 comments

Comments

@xforceco
Copy link

@xforceco xforceco commented Jun 15, 2015

In angular (1.3.16), for 'Stories' as a resource defined by a factory, I run
...
Stories.query({array: [1,2,3], a: 1},callback);
...

In node (latest stable),
...
router.get("/stories",function(req,res,next){
console.log(req.query);
});
....

Output:
{a: 1}

'Expected' Output:
{array: [1,2,3], a: 1}

I am not sure whether it is the same with the following fixed issue, it looks similar though
#2256

@xforceco xforceco changed the title About #2256 $resource parameter object with array values cannot be passed to server $resource parameter object with array values cannot be passed to server Jun 15, 2015
@gkalpak gkalpak self-assigned this Jun 15, 2015
@gkalpak
Copy link
Member

@gkalpak gkalpak commented Jun 15, 2015

This eems to work as expected. If you check out the console, you'll see that the requested URL's query part for Stories.query({a: 1, b: [1, 2, 3]}); is: ?a=1&b=1&b=2&b=3.
Maybe it is a Node.js issue or something in between.

In any case, it doesn't seem to be an issue with ngResource.

(Feel free to reopen, if you can provide more info showing that it is something in Angular/ngResource that causes a problem.)

@gkalpak gkalpak closed this Jun 15, 2015
@xforceco
Copy link
Author

@xforceco xforceco commented Jun 15, 2015

You are right, I found I am actually stuck with a bug in my code instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.