title: Angular 2 - Service as NgModule to not have to declare all providers?
body: <p>I have a service called CalculationService, which is declared <code>@Injectable()</code>. This service uses a whole lot of other injected classes, each of which is also declared as <code>@Injectable()</code> and given to the constructor of CalculationService via <code>@Inject()</code>.</p>
  
  <p>Now when I want to use the service inside my app, the AppComponent looks like this (for the sake of convenience, I omitted the Typescript imports):</p>
  
  <pre><code>@NgModule({
    declarations: [AppComponent],
    imports: [
      BrowserModule,
      RouterModule.forRoot(routeConfig),
      PlannerModule
    ],
    providers: [
      InputService,
      Bausparen,
      BausparenInput,
      Girokonto,
      GirokontoInput,
      Immobilien,
      ImmobilienInput,
      Lebensversicherung,
      LebensversicherungInput,
      Rentenversicherung,
      RentenversicherungInput,
      Tagesgeld,
      TagesgeldInput,
      Termingeld,
      TermingeldInput,
      Wertpapiere,
      WertpapiereInput
    ],
    bootstrap: [AppComponent]
  })
  export class AppModule {
  }
  </code></pre>
  
  <p>I don't need to access all the providers declared in the app module directly. The only class in need is the CalculationService but I don't know how to declare the providers in the Service.</p>
  
  <p>Is there a way to refactor the service as a module, i.e. declare the providers inside the CalculationService? Or do I have to get rid of all the <code>@Injectable()</code>s (Bausparen and so on) and create objects inside the Calculation Service, so that no provider is needed?</p>