I have a nested route (see below).
this.route('home', {
path: '/'
}, function() {
this.route('foo', {
path: '/foo'
});
this.route('bar', {
path: '/bar'
});
});
The foo
route model return a collection (array).
Inside parent route home
, I define a function called reloadModel
.
I try to reload the model from the controller but failed (produce an undefined function error, controller.get(...).refresh is not a function
or controller.get(...).reload is not a function
).
reloadModel() {
const controller = this.controllerFor('home/a');
controller.get('model').reload();
},
I would like to reload the child route's model from the parent route; however, I do now know to can I get the child route?
My Question
How can I refresh
model in route foo
or bar
from route home
?
Any hint is appreciated.
get
,controllerFor
orreload
? – nem035model
I retrived from the controller just a plain object? – Glassreload
method. – nem035