What exactly the chain of modelFor and get do at Route?


#1

I am in Route. What exactly the chain of modelFor and get do the job ?

Syntax:

 import Ember from "ember";

var PagesRoute = Ember.Route.extend({
    model: function(){
        return this.modelFor('campaign').get('pages'); # what exactly it is doing here ?
    }
});
export default PagesRoute;

#2

return this.modelFor(‘campaign’).get(‘pages’); # what exactly it is doing here ?

It’s saying get me the current model that is on the route campaign and get the pages property from that model.

Documentation: http://emberjs.com/api/classes/Ember.Route.html#method_modelFor