dimanche 28 juin 2015

How do I add relationships to an Object in the EmberData (v. 1.13.4) store?

I have a basket object and many fruit objects. When I want to add a new fruit into a basket how do I add the new fruit into the basket with ember data?

store.push('basket', {
                        id: 1,
                        fruits: [3]
                    });

This overwrites the existing fruits array in the store, which i don't want.

Is there a way to merge the content of the fruits array? How is this done in a clean and simple way?




Aucun commentaire:

Enregistrer un commentaire