github.com/outbrain/consul@v1.4.5/ui-v2/app/routes/dc.js (about)

     1  import Route from '@ember/routing/route';
     2  import { inject as service } from '@ember/service';
     3  import { hash } from 'rsvp';
     4  import { get } from '@ember/object';
     5  export default Route.extend({
     6    repo: service('repository/dc'),
     7    settings: service('settings'),
     8    model: function(params) {
     9      const repo = get(this, 'repo');
    10      return hash({
    11        dcs: repo.findAll(),
    12      }).then(function(model) {
    13        return hash({
    14          ...model,
    15          ...{
    16            dc: repo.findBySlug(params.dc, model.dcs),
    17          },
    18        });
    19      });
    20    },
    21    setupController: function(controller, model) {
    22      this._super(...arguments);
    23      controller.setProperties(model);
    24    },
    25  });