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

HOWTO call `findBelongsTo` on the JSONAPIAdapter via Store?

$
0
0

@johnnyicon wrote:

Does anyone have any practical examples of how to call the #findBelongsTo method on the JSONAPIAdapter?

To give some context, I have a house model which has one (1) master-bedroom.

In my master-bedroom model, I have defined the relationship to the its house as such:

export default DS.Model.extend({
    ...
    house: DS.belongsTo('house')
    ...
});

I’m trying to access the master-bedroom of a house from a house route (e.g., http://localhost:4200/house/1).

I would like to use the #findBelongsTo method to do so because the URL this method generates makes the most sense to me (e.g., http://localhost:4200/house/1/master-bedroom).

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4828

Trending Articles