title: No component factory found. Did you add it to @NgModule.entryComponents?
body: <p>While using ag-grid with angular4, I'm stuck with below error message.</p>
  
  <p>I'm trying to display row data after fetch json via HTTP.</p>
  
  <pre><code>this.gridOptions.api.setRowData(this.gridOptions.rowData);
  </code></pre>
  
  <p>But my code made below error message.</p>
  
  <blockquote>
    <p>ERROR Error: No component factory found for RedComponentComponent. Did
    you add it to @NgModule.entryComponents?</p>
  </blockquote>
  
  <p>This is my app module code.  I'd already set to entryComponents.</p>
  
  <pre><code>import { BrowserModule } from '@angular/platform-browser';
  import { NgModule } from '@angular/core';
  import { FormsModule } from '@angular/forms';
  import { HttpModule } from '@angular/http';
  import { AgGridModule} from "ag-grid-angular/main";
  
  import { AppComponent } from './app.component';
  import { MyGridApplicationComponent } from './my-grid-application/my-grid-application.component';
  import { RedComponentComponent } from './red-component/red-component.component';
  
  @NgModule({
    imports: [
      BrowserModule,
      AgGridModule.withComponents(
        [RedComponentComponent]
      ),
      FormsModule,
      HttpModule
    ],
    declarations: [
      AppComponent,
      MyGridApplicationComponent,
      RedComponentComponent
    ],
    entryComponents: [
      RedComponentComponent
    ],  
    providers: [],
    bootstrap: [AppComponent]
  })
  export class AppModule { }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/GI3a7.png" rel="noreferrer">error position of my code</a></p>
  
  <p>My Question.  Why this code can't resolve this component.</p>