Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4838

EmberJS - Relationship not remotly pushed

$
0
0

@Charles_Bourasseau wrote:

I have two model with a one to one relation. I only need one direction of the relationship.

App.A = DS.Model.extend({
    b: DS.belongsTo('b', { async: true }),
});

App.B = DS.Model.extend({
    name: DS.attr('string'),
});

Model A is load from the server. Model B is manually pushed using store.pushPayload.

If Model B is loaded before Model A, everything is fine and {{a.b.name}} works correctly inside the template. But when Model A is loaded before Model B, then the name is empty (the whole relation is not set actually).

How can I tell model A that model B was loaded?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4838

Trending Articles