title: Angular2 - Group and selectively add module declarations
body: <p>We're using angular2 and the angular-cli, and our app is becoming fairly large and has a large number of <code>declarations:</code> in the <code>app.module.ts</code> file. </p>
  
  <pre><code>@NgModule({
    declarations: [
      GameComponent1,
      GameComponent2,
      GameComponent3,
      StatsComponent1,
      StatsComponent2,
      StatsComponent3,
      AboutPageComponent1,
      AboutPageComponent2,
      AboutPageComponent3,
      AboutPageComponent4,
    ],...
  </code></pre>
  
  <p>First of all, is there a way to group related component declarations like the following:</p>
  
  <pre><code>@NgModule({
    declarations: [
      GameComponentsGroup,
      StatsComponentsGroup,
      AboutPageComponentsGroup,
    ],...
  </code></pre>
  
  <p>Then could it be possible to selectively switch on and off components from being included in the build, for different environments.</p>
  
  <pre><code>if(environment.envName == "developmentWithStats")
    appmodule add StatsComponentsGroup
  </code></pre>
  
  <p>The goal is to allow different features to be included in different builds.</p>
  
  <p>I know I'm missing some key knowledge here, any help would be much appreciated.</p>