For the More Curious: setupController and afterModel
The hook setupController is for setting
properties on a controller that will render those properties.
It is possible to run the default behavior of setting
the controller
’s
model
property while setting other active controller
properties with this._super
:
setupController(controller, model) { this._super(controller, model); // this.controllerFor('[other controller]').set("[property name]", [value]); }
The hook afterModel is run after the model
hook (which is a Promise
) is resolved. Note that there are
special cases where the model hook would not be
called because the Promise
has already been resolved. In these cases,
afterModel is called before
setupController and can be used ...
Get Front-End Web Development: The Big Nerd Ranch Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.