0

I'm overwriting RequestOptions for my application by doing something like:

export class RequestOptionsService extends RequestOptions {
  ...
}

and after:

{ provide: RequestOptions, useClass: RequestOptionsService },

Now I would like to inject another service inside my child -RequestOptionsService, but the problem is that there is parameter(not dependancy injection one) inside RequestOptions:

enter image description here

how will it reflect to my RequestOptionsService child?

Stepan Suvorov
  • 25,118
  • 26
  • 108
  • 176
  • I'm not sure what is the question. These variables (including highlighted responseType) are destructured from RequestOptionsArgs object. – Estus Flask Feb 02 '17 at 13:05
  • the question is how to mix injectables and non-injectables in one constructor. here, for example constructor already has one parameter, that is not injectable. – Stepan Suvorov Feb 02 '17 at 13:32
  • The question in the title doesn't reflect the body. Because generally you can't do that. If it is specific to RequestOptions, this changes everything, because it is special case. RequestOptions isn't injectable. BaseRequestOptions is. I'm quite sure it was already discussed on SO. See http://stackoverflow.com/questions/38436658/angular-2-inject-service-into-extended-classbaserequestoptions for example. – Estus Flask Feb 02 '17 at 13:52

0 Answers0