jeudi 26 octobre 2017

How does a query from the route handler and ember data communicate?

How can a model() request find all data from 'rental' or ../models/rental.js?

model() {
    return this.get('store').findAll('rental'); // 'rental' refers to ../models/rental.js?
}

A model() call will fetch data from /api/rentals defined in the adapter. But how does /models/rental.js talk to the data store and work alongside api calls?

In the quick start tutorial, it says

The store service is injected into all routes and components in Ember.
It is the main interface you use to interact with Ember Data.

I'm just trying to wrap my head around how the route handler and ember data communicate from a to z.




Aucun commentaire:

Enregistrer un commentaire