Closed richthedev closed 7 years ago
There's work being done to create a custom serializer https://github.com/FacultyCreative/ngActiveResource/issues/18.
If your format is always
{ object: { id: X, attribute: x } }
for single objects
and I assume
{ objects: [{ id: X, attribute: x }] }
for multiple objects.
you can easily hack together a temporary solution by modifying the GET function in lib/angular-resource/base/base.js
see https://github.com/FacultyCreative/ngActiveResource/issues/31.
Also the main developers are focused on a TidyUpMission at the moment so Custom Serializers etc. are temporarily on the backburner. Please see https://github.com/FacultyCreative/ngActiveResource/issues/34
Our rails API returns a root element in the response: { user: { id: 1, username: "user1" } }
Is there a way to tell ngActiveResource to parse the data correctly?