Let's say I have a simple model my-data
:
export default Model.extend({
foo: attr(),
bar: attr()
});
Let's also say my backend is setup so when I use findAll()
which calls /api/v1/my-data/
, the response only returns the foo
attribute, but if I use findRecord()
-- eg, /api/v1/my-data/5
--, the response contains both foo
and bar
.
Is EmberJS smart enough to merge these two responses without overwriting any attribute that's not in the response? In other words, if I first do a findRecord('my-data', 5)
, then both foo
& bar
will be set, but if I subsequently call findAll()
, which will also contain record 5
, can I expect the record with id 5
to still have both foo
and bar
set, or will findAll()
completely overwrite record 5
with bar
becoming unset or NULL?
Aucun commentaire:
Enregistrer un commentaire