I have the following JSON (simple example):
{ id: 101, firstName: "John", surname: "Doe" }
But I want my model to use lastName instead of surname . Something like this might be:
App.Person = DS.Model.extend({ firstName: DS.attr('string'), lastName: DS.attr('string', { key: 'surname' }) });
I could have sworn that somewhere I saw something showing how to do it, but for life it could not find me. I also did not find anything obvious in the ember data source.
I tried the key , name , id , alias and map settings in the attribute parameters, but none of them do the trick. Is there any way to do this?
source share