open-nomad/ui/app/routes/jobs/job/versions.js
2018-03-05 09:32:03 -08:00

22 lines
563 B
JavaScript

import Route from '@ember/routing/route';
import { watchRelationship } from 'nomad-ui/utils/properties/watch';
export default Route.extend({
model() {
const job = this.modelFor('jobs.job');
return job.get('versions').then(() => job);
},
setupController(controller, model) {
controller.set('watcher', this.get('watchVersions').perform(model));
return this._super(...arguments);
},
deactivate() {
this.get('watchVersions').cancelAll();
return this._super(...arguments);
},
watchVersions: watchRelationship('versions'),
});