Hmmm, I think we should check the headers and do JSON.parse() if
Content-Type is application/json, rather than checking what is the
string look like...
In meantime, you can override the default transformResponse function like this:
$http.defaults.transformResponse = [function(data) {
// replace XSFR protection token
data = data.replace(/^\)\]\}',?\n/, '');
return header('Content-Type') === 'application/json' ?
JSON.parse(data) : data;
}];
V.
> --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To view this discussion on the web visit
>
https://groups.google.com/d/msg/angular/-/0PXejjIni0gJ.
> To post to this group, send email to
ang...@googlegroups.com.
> To unsubscribe from this group, send email to
>
angular+u...@googlegroups.com.
> For more options, visit this group at
>
http://groups.google.com/group/angular?hl=en.