Getting $resource query response as a string

2,620 views
Skip to first unread message

Amira LAKHAL

unread,
Feb 20, 2013, 11:07:27 AM2/20/13
to ang...@googlegroups.com
Hi everyone!

I'm trying to get a query response as a String but I'm getting an object instead...
The response is "my response".
When I call myService.query, I'm getting: "{"0":"m","1":"y","2":"/" ....}"

My service looks like this:

myApp.factory('myService', function($resource){
return $resource('myUrl', {}, {
query: {method:'GET', params:{}, isArray:false}
  });
});

Any ideas?

Amira


Pawel Kozlowski

unread,
Feb 20, 2013, 11:11:04 AM2/20/13
to ang...@googlegroups.com
Hi!

$resource, as it stands today, can only work with arrays or objects
returned from a backend, no raw strings.
CHange the output of your backend or switch to $http.

Cheers,
Pawel
> --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to angular+u...@googlegroups.com.
> To post to this group, send email to ang...@googlegroups.com.
> Visit this group at http://groups.google.com/group/angular?hl=en-US.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
Looking for bootstrap-based widget library for AngularJS?
http://angular-ui.github.com/bootstrap/

Amira LAKHAL

unread,
Feb 20, 2013, 11:13:03 AM2/20/13
to angular

Ah ok. Thanks :)

Amira
Reply all
Reply to author
Forward
0 new messages