jeudi 17 mai 2018

Setting a new relation in EmberJS without original model

So I have a model created/loaded normally:

        let contact = self.get('store').createRecord('contact');

I then get the address, which is a BelongsTo relation on the model:

        let address = contact.get('address');

the returned address variable is a Proxy object, which the promise resolves as either the related model or null.

The question is how can I create a new address model and assign it to the original contact object, but with only the address proxy object?




Aucun commentaire:

Enregistrer un commentaire