github.com/outbrain/consul@v1.4.5/ui-v2/app/routes/dc/services/show.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  
     6  export default Route.extend({
     7    repo: service('repository/service'),
     8    queryParams: {
     9      s: {
    10        as: 'filter',
    11        replace: true,
    12      },
    13    },
    14    model: function(params) {
    15      const repo = get(this, 'repo');
    16      return hash({
    17        item: repo.findBySlug(params.name, this.modelFor('dc').dc.Name),
    18      }).then(function(model) {
    19        return {
    20          ...model,
    21          ...{
    22            items: model.item.Nodes,
    23          },
    24        };
    25      });
    26    },
    27    setupController: function(controller, model) {
    28      this._super(...arguments);
    29      controller.setProperties(model);
    30    },
    31  });