1
votes

Can't Ember-data just see the JSON response it gets and understand by it which attributes are used by the server?
For example if the response for 'GET /api/user/1' is like:

{
    id: 1,
    first_name: 'Miki',
    last_name: 'Coco',
    age: 17
}

Its pretty obvious that the user model has just first_name, last_name and age.

Why would i need to configure it?

1

1 Answers

1
votes

Here's the things that I can think of off the top of my head.

  1. Change management (isDirty)
  2. Serialization/deserialization of different types
  3. You can put other properties on the model that won't necessarily be sent back to the server on save etc
  4. Relationship handling

Honestly, I avoid Ember Data for simple models that I don't need CRUD for, it's overkill (unless I'm worried about client side caching etc)