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

Ember Data Proxy BelongsTo

$
0
0

@Alonski wrote:

Hey friends,

I have 2 models.

The parent has a hasMany relationship with the children.

Each child has a belongsTo relationship with its parent.

Before upgrading from Ember Data v2.18 -> 3.7 I was able to get the parent from the child by doingchild.parent or child.get("parent") and it just worked.

Now I am getting a Proxy object. I tried setting async: false on the parent belongsTo like this: parent: belongsTo("parent-model", { async: false })

This didn’t work either.

The children are embedded of the parent so they are all loaded in the same request. Any ideas? Thanks!

export default Model.extend({
    children: hasMany("child-model", { async: false }),
});
export default Model.extend({
    parent: belongsTo("parent-model")
});

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4826

Trending Articles