John Cowen 967afbaaf4
ui: Outlet Loading (#8779)
Moves all Route/model hook loading to use Outlet components which listen on route change.
2020-10-01 09:33:22 +01:00

26 lines
720 B
JavaScript

import SingleRoute from 'consul-ui/routing/single';
import { inject as service } from '@ember/service';
import { hash } from 'rsvp';
import WithTokenActions from 'consul-ui/mixins/token/with-actions';
export default SingleRoute.extend(WithTokenActions, {
repo: service('repository/token'),
settings: service('settings'),
model: function(params, transition) {
return this._super(...arguments).then(model => {
return hash({
...model,
...{
routeName: this.routeName,
token: this.settings.findBySlug('token'),
},
});
});
},
setupController: function(controller, model) {
this._super(...arguments);
controller.setProperties(model);
},
});