Given the following:
@NgModule( {} )
export class ServicesModule {
static forRoot() {
return {
ngModule: ServicesModule,
providers: [ ...moduleProviders ]
}
}
}
const moduleProviders = [ CountryService, DenomService];
export {CountryService, DenomService}
Is there some way in TypeScript or Angular2 that I could prevent the duplication of CountryService, DenomService in the moduleProviders and the export?
The spread operator works quite well in the providers: property, but using the spread in the export will not work as below
export { ...moduleProviders }
Any suggestion as to what I could do prevent the duplication mentioned.
Thanks