i'm doing a small application and i realized yesterday about this thing i could not really understand.
I have my controller in Java listening for requests, it returns a Map with more than one value. But when I use ngResource in the controller, i'm calling .get() method instead of .query() one, and then on the view i can iterate over the response i get with the .get() with something like x in response...
. Wasn't the query() suposed to be for arrays and get() just for one object?
Could someone explain this please? thanks
EDIT So, the json I'm reciving from {"1":"PRUEBA","2":"HOLA"}
is this, and if I use .query() I'm getting the following error:
Error in resource configuration for action
Error in resource configuration for action
{0}. Expected response to contain an {1} but got an {2} (Request: {3} {4})
. Expected response to contain an query but got an array (Request: object GET)
So, I still don't understand why do I need a .get if I'm getting an array...