Вы можете вызвать refresh
на своем родительском маршруте.
Теперь самый простой способ вызвать действие на вашем родительском маршруте - это определить его, а затем использовать send
на вашем контроллере, чтобы действие всплыло.
Итак, ваш родительский маршрут:
class ParentRoute extends Route {
@action
refreshParent() { // dont name it refresh because of the naming conflict
this.refresh();
}
}
и ваш дочерний контроллер:
class ChildController extends Controller {
@action
refreshParentRoute() { // again, another name
// this will first look for a `refreshParent` action on this controller,
// then the `child` route and last the `parent` route.
this.send('refreshParent');
}
}