title: Angular2: How to resolve Component is not part of any NgModule ...?
body: <p>I am new to angular 2. Currently I am still a learner. My angular 2 version is 2.1. I have a simple file structure as below:</p>
  
  <p><a href="https://i.stack.imgur.com/Z9Hee.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Z9Hee.jpg" alt="enter image description here"></a></p>
  
  <p>The content of <strong>app.ts</strong> is as below:</p>
  
  <pre><code>import { Component } from "@angular/core";
  
  @Component({
      selector: 'my-app',
      template: `
          &lt;a&gt;Hello&lt;/a&gt;
          &lt;a&gt;About&lt;/a&gt;
  `})
  export class App { }
  </code></pre>
  
  <p>well, it is really simple. The content of <strong>helloSolarSystem.ts</strong> is as below:</p>
  
  <pre><code>import { NgModule, Type } from '@angular/core';
  import { BrowserModule } from '@angular/platform-browser';
  import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
  
  import { App } from 'components/app';
  
  let INITIAL_COMPONENTS = { App };
  
  @NgModule({
      imports: [ BrowserModule
      ],
      declarations: INITIAL_COMPONENTS,
      bootstrap: [App]
  })
  class HelloSolarSystemModule extends Type{}
  
  platformBrowserDynamic().bootstrapModule(HelloSolarSystemModule);
  </code></pre>
  
  <p>It's quite simple too, the content of <strong>config.js</strong> is as below:</p>
  
  <pre><code>System.config({
  //use typescript for compilation
  transpiler: 'typescript',
  //typescript compiler options
  typescriptOptions: {
      emitDecoratorMetadata: true
  },
  paths: {
      //'npm:': 'https://unpkg.com/'
      'npm:': 'node_modules/'
  },
  //map tells the System loader where to look for things
  map: {
  
      'app': './src',
      'components': './components',
      'config': './config',
  
      '@angular/core': 'npm:@angular/core/bundles/core.umd.js',
      '@angular/common': 'npm:@angular/common/bundles/common.umd.js',
      '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
      '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
      '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
      '@angular/http': 'npm:@angular/http/bundles/http.umd.js',
      '@angular/router': 'npm:@angular/router/bundles/router.umd.js',
      '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
  
      '@angular/core/testing': 'npm:@angular/core/bundles/core-testing.umd.js',
      '@angular/common/testing': 'npm:@angular/common/bundles/common-testing.umd.js',
      '@angular/compiler/testing': 'npm:@angular/compiler/bundles/compiler-testing.umd.js',
      '@angular/platform-browser/testing': 'npm:@angular/platform-browser/bundles/platform-browser-testing.umd.js',
      '@angular/platform-browser-dynamic/testing': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js',
      '@angular/http/testing': 'npm:@angular/http/bundles/http-testing.umd.js',
      '@angular/router/testing': 'npm:@angular/router/bundles/router-testing.umd.js',
  
      'rxjs': 'npm:rxjs'
  },
  //packages defines our app package
  packages: {
      app: {
          main: 'helloSolarSystem.ts',
          defaultExtension: 'ts'
      },
  
      components : {
          defaultExtension: 'ts'
      },
  
      rxjs: {
          defaultExtension: 'js'
      }
  }
  </code></pre>
  
  <p>});</p>
  
  <p>Not too much magic. However, when I run the index.html in browser, the console will return:
  <strong>zone.js:232 Error: (SystemJS) Component App is not part of any NgModule or the module has not been imported into your module.(…)</strong></p>
  
  <p>Anybody know why?</p>