lundi 10 septembre 2018

EmberJS "detail" page fetches the model automatically - is this normal?

Long time reader - first time questioner here.

I am developing a medium sized application in EmberJS which is a framework that I have been using for a while.

Today I have realised that it fetches model data from the server without me writing any code.

I have a main route called "students". Then there is a "list" sub route where the model() function of this route calls the store to fetch all the students and lists them on a table.

On each row of this table I link to another sub route called "detail" where it accepts the ID of each student as an argument. However inside the route.js file for this route there is no model() function querying any information about the specific student from the server.

Ember does this automatically somehow as I can see the appropriate network request being made using chrome dev tools.

How is this happening and is it normal?

Thank you in advance.




Aucun commentaire:

Enregistrer un commentaire