title: What does the app.module.ts file serve for, what should I do inside of it?
body: <p>I'm getting used to Angular 2 but I have a few questions concerning the <em>app.module.ts</em> file.</p>
  
  <ul>
  <li>Why do I have to do the imports in this file since I will be doing
  the inputs again in the <em>app.components.ts</em> file. </li>
  </ul>
  
  <p>For example: I
     import my custom pipe and then again I have to import it in my
     <em>app.components.ts</em> file</p>
  
  <pre><code>import { FirstPipePipe } from './first-pipe.pipe';
  
  @NgModule({
       declarations: [
         AppComponent,
         SecondComponent,
         ThirdComponent,
         FirstComponent,
         FirstPipePipe
       ],
       imports: [
         BrowserModule, RouterModule.forRoot(appRoutes), HttpModule
       ],
       providers: [FetchDataService],
       bootstrap: [AppComponent]    })
  </code></pre>
  
  <p>Then I have the </p>
  
  <pre><code>imports: [
             BrowserModule, RouterModule.forRoot(appRoutes), HttpModule
           ],
  </code></pre>
  
  <p>Why do I import some classes and others not?</p>
  
  <p>Why are the providers here, since again, they appear in the    <em>app.component.ts</em></p>
  
  <pre><code>providers: [FetchDataService]
  </code></pre>
  
  <p>Basically, I have to rewrite everything in my <em>app.component.ts</em> file.</p>
  
  <p><strong>What is the purpose of the app.module.ts</strong>?</p>