Description
The constructors for the Api classes in typescript-angular2 currently have the definition:
constructor(protected http: Http, @Optional() basePath: string)
To be able to provide a value and have DI use this value, would it be better to set this up as:
constructor(protected http: Http, @Optional()@Inject(BASE_PATH) basePath: string)
And define a variables file with:
export const BASE_PATH = new OpaqueToken('basePath');
And then this could be utilised on app bootstrap by:
Import { BASE_PATH } from './service/variables';
bootstrap(AppComponent, [
{ provide: BASE_PATH, useValue: 'http://myservice:5000' }
]);
Swagger-codegen version
2.2.0
I'd be happy to make the contribution via a PR, just checking that there is no prior agreed way. And that this would be an appropriate way to handle this case?
Description
The constructors for the Api classes in typescript-angular2 currently have the definition:
To be able to provide a value and have DI use this value, would it be better to set this up as:
And define a variables file with:
And then this could be utilised on app bootstrap by:
Swagger-codegen version
2.2.0
I'd be happy to make the contribution via a PR, just checking that there is no prior agreed way. And that this would be an appropriate way to handle this case?