title: Angular 2 Karma Test 'component-name' is not a known element
body: <p>In the AppComponent, I'm using the nav component in the HTML code. The UI looks fine. No errors when doing ng serve. and no errors in console when I look at the app.</p>
  
  <p>But when I ran Karma for my project, there is an error: </p>
  
  <pre><code>Failed: Template parse errors: 
  'app-nav' is not a known element:
  1. If 'app-nav' is an Angular component, then verify that it is part of this module.
  2. If 'app-nav' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
  </code></pre>
  
  <p>In my <strong>app.module.ts</strong>:</p>
  
  <p>there is:</p>
  
  <pre><code>import { NavComponent } from './nav/nav.component';
  </code></pre>
  
  <p>It is also in the declarations part of NgModule</p>
  
  <pre><code>@NgModule({
    declarations: [
      AppComponent,
      CafeComponent,
      ModalComponent,
      NavComponent,
      NewsFeedComponent
    ],
    imports: [
      BrowserModule,
      FormsModule,
      HttpModule,
      JsonpModule,
      ModalModule.forRoot(),
      ModalModule,
      NgbModule.forRoot(),
      BootstrapModalModule,
      AppRoutingModule
    ],
    providers: [],
    bootstrap: [AppComponent]
  })
  </code></pre>
  
  <p>I'm using the <code>NavComponent</code> in my <code>AppComponent</code></p>
  
  <p><strong>app.component.ts</strong></p>
  
  <pre><code>import { Component, ViewContainerRef } from '@angular/core';
  import { Overlay } from 'angular2-modal';
  import { Modal } from 'angular2-modal/plugins/bootstrap';
  import { NavComponent } from './nav/nav.component';
  
  @Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.css']
  })
  export class AppComponent {
    title = 'Angela';
  }
  </code></pre>
  
  <p><strong>app.component.html</strong></p>
  
  <pre><code>&lt;app-nav&gt;&lt;/app-nav&gt;
  &lt;div class="container-fluid"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I have seen a similar question, but the answer in that question says we should add NgModule in the nav component that has a export in that, but I'm getting compile error when I do that. </p>
  
  <p>There is also: <strong>app.component.spec.ts</strong></p>
  
  <pre><code>import {NavComponent} from './nav/nav.component';
  import { TestBed, async } from '@angular/core/testing';
  import { AppComponent } from './app.component';
  </code></pre>