open-nomad/ui/app/routes/application.js
Michael Lange fc5fb7bde9 Handle errors in the application route
This is the only way to preserve the URL in all cases.
2017-10-05 14:39:06 -07:00

22 lines
365 B
JavaScript

import Ember from 'ember';
const { Route } = Ember;
export default Route.extend({
resetController(controller, isExiting) {
if (isExiting) {
controller.set('error', null);
}
},
actions: {
didTransition() {
window.scrollTo(0, 0);
},
error(error) {
this.controllerFor('application').set('error', error);
},
},
});