title: entryComponents is not working in Angular 6
body: <p>I have a problem when using ng-bootstrap modal in angular 6.</p>
  
  <p>First, I have 2 module:</p>
  
  <p><code>AppModule</code> and <code>ComponentModule</code></p>
  
  <p>Here is <code>ComponentModule</code>:</p>
  
  <pre class="lang-js prettyprint-override"><code>@NgModule({
    imports: [
      CommonModule,
      FormsModule,
      ComponentRoutingModule,
      BsDropdownModule.forRoot(),
      TabsModule,
      PaginationModule.forRoot(),
      PopoverModule.forRoot(),
      ProgressbarModule.forRoot(),
      TooltipModule.forRoot(),
      ModalModule.forRoot(),
      NgMultiSelectDropDownModule.forRoot(),
    ],
    declarations: [
     CategoryComponent,
     CourseComponent,
     ModalComponent,
     CategoryModalComponent,
    ],
    entryComponents: [CategoryModalComponent],
  })
  export class ComponentModule { }
  </code></pre>
  
  <p><code>ComponentModule</code> is where I put component that will be displayed after I logged in.</p>
  
  <p>In a <code>ComponentModule</code>, I have a Course component:</p>
  
  <pre class="lang-js prettyprint-override"><code>@Component({
    selector: 'app-course',
    template: '&lt;app-modal&gt;&lt;/app-modal&gt;',
    styleUrls: ['./course.component.scss']
  })
  export class CourseComponent implements OnInit {
  
    constructor() { }
  
    ngOnInit() {
    }
  
  }
  </code></pre>
  
  <p>Here is <code>ModalComponent</code> in the same module:</p>
  
  <pre class="lang-js prettyprint-override"><code>@Component({
    selector: 'app-modal',
    template: '&lt;button class="btn btn-lg btn-outline-primary" (click)="open()"&gt;Launch demo modal&lt;/button&gt;',
    styleUrls: ['./modal.component.scss']
  })
  export class ModalComponent implements OnInit {
    constructor(private modalService: NgbModal) {}
  
    open() {
      const modalRef = this.modalService.open(CategoryModalComponent);
      modalRef.componentInstance.name = 'World';
    }
  
    ngOnInit() {
    }
  
  }
  </code></pre>
  
  <p>and</p>
  
  <pre class="lang-js prettyprint-override"><code>@Component({
    selector: 'app-category-modal',
    template: `
      &lt;div class="modal-header"&gt;
        &lt;h4 class="modal-title"&gt;Hi there!&lt;/h4&gt;
        &lt;button type="button" class="close" aria-label="Close" (click)="activeModal.dismiss('Cross click')"&gt;
          &lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;
        &lt;/button&gt;
      &lt;/div&gt;
      &lt;div class="modal-body"&gt;
        &lt;p&gt;Hello, {{name}}!&lt;/p&gt;
      &lt;/div&gt;
      &lt;div class="modal-footer"&gt;
        &lt;button type="button" class="btn btn-outline-dark" (click)="activeModal.close('Close click')"&gt;Close&lt;/button&gt;
      &lt;/div&gt;
    `,
    styleUrls: ['./category-modal.component.scss']
  })
  export class CategoryModalComponent implements OnInit {
  
    @Input() name;
  
    constructor(public activeModal: NgbActiveModal) {}
  
    ngOnInit() {
    }
  
  }
  </code></pre>
  
  <p>I expect that when I click button in <code>ModalComponent</code>, I will show a modal that its content is in <code>CategoryModalComponent</code>. But it showed me an error:</p>
  
  <pre><code>ModalComponent.html:4 ERROR Error: No component factory found for CategoryModalComponent. Did you add it to @NgModule.entryComponents?
      at noComponentFactoryError (core.js:3256)
      at CodegenComponentFactoryResolver.push../node_modules/@angular/core/fesm5/core.js.CodegenComponentFactoryResolver.resolveComponentFactory (core.js:3291)
      at NgbModalStack.push../node_modules/@ng-bootstrap/ng-bootstrap/fesm5/ng-bootstrap.js.NgbModalStack._createFromComponent (ng-bootstrap.js:7643)
      at NgbModalStack.push../node_modules/@ng-bootstrap/ng-bootstrap/fesm5/ng-bootstrap.js.NgbModalStack._getContentRef (ng-bootstrap.js:7581)
      at NgbModalStack.push../node_modules/@ng-bootstrap/ng-bootstrap/fesm5/ng-bootstrap.js.NgbModalStack.open (ng-bootstrap.js:7444)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/xyCNj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xyCNj.png" alt="enter image description here"></a></p>
  
  <p>According the error, I added it in <code>ComponentModule</code> but it's not working.</p>
  
  <p>Could you please give any advice to solve it?</p>