github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/ui/app/routes/allocations/allocation/index.js (about)

     1  import Route from '@ember/routing/route';
     2  
     3  export default class IndexRoute extends Route {
     4    setupController(controller, model) {
     5      // Suppress the preemptedByAllocation fetch error in the event it's a 404
     6      if (model) {
     7        const setPreempter = () => controller.set('preempter', model.preemptedByAllocation);
     8        model.preemptedByAllocation.then(setPreempter, setPreempter);
     9      }
    10  
    11      return super.setupController(...arguments);
    12    }
    13  
    14    resetController(controller, isExiting) {
    15      if (isExiting) {
    16        controller.watchNext.cancelAll();
    17      }
    18    }
    19  }