Get params component from other component


#1

Hello! I have such structure in router.js

  this.route('provider', {
    path: 'provider/:provider_name'
  }, function () {
    this.route('forms');
  });

In provider/route.js

import Ember from 'ember';

const {
  inject: { service }
} = Ember;

export default Ember.Route.extend({
  provider: service(),

  model(params) {
    return this.get('provider').get(params.provider_name);
  },

  serialize: function(model) {
    return { provider_name: model.get('name') };
  }
});

In provider/forms/route.js

import Ember from 'ember';

const {
  inject: { service }
} = Ember;

export default Ember.Route.extend({

  forms: service('provider.forms'),

  model(query) {
    return this.get('forms').getPage(query);
  }
});

How i can get provider_name in forms? And do the following in provider/forms/route.js

model(query) {
    return this.get('forms').getPage(query.provider_name);
  }

Or in any other way to convey provider_name to the model. Thanks for help.