title: dynamically render a component in lazy loaded module with AOT throws cant find component factory
body: <h2>Current behavior</h2>
  
  <p>I declared those dynamic components as entry components in the module where I also want to render them. With JIT it works fine.
  Following structure has the part of my app I want to render them: <code>app -&gt; home (lazy) -&gt; contracts (lazy) -&gt; search</code>. </p>
  
  <p>So I added those components to the module I use for the <code>search component/route</code>. When I'm compiling with AOT, everytime I visit the search route, the app tells me there is no component factory. Of course I searched google and found some results:</p>
  
  <p>I tried adding them to the <code>ANALYZE_FOR_ENTRY_COMPONENTS</code> provider, I tried to import a ModuleWithProviders with <code>.forRoot()</code> in my app.module and I also tried simply importing and declaring my dynamic and all of its dependant components in the root module (app.module). Everything resulting in the same error.</p>
  
  <p>I declare my dynamic components as entry components like so:
  <code><pre>
  @NgModule({
    imports: [SharedComponentsModule, FinoSchemaFormsModule, TabGroupModule, FinoInputModule],
    declarations: [EnergySearchSettingsComponent, DslSearchSettingsComponent, MobileSearchSettingsComponent, ComparisonDetailSectionComponent],
    entryComponents: [EnergySearchSettingsComponent, DslSearchSettingsComponent, MobileSearchSettingsComponent],
    exports: [EnergySearchSettingsComponent, DslSearchSettingsComponent, MobileSearchSettingsComponent, ComparisonDetailSectionComponent],
    providers: [CategoryMappingProvider]
  })
  export class ComparisonComponentsModule { }
  </code></pre></p>
  
  <p>This module gets imported in the <code>SearchModule</code>, where also my <code>SearchComponent</code> is declared. In this component I want to render those components dynamically using the <code>ComponentFactoryResolver</code> I inject in the <code>SearchComponent</code>. </p>
  
  <pre><code>ngOnInit() {
      this.searchSettingsComponent = this.comparisonService.getSearchComponent(); // returns either EnergySearchSettingsComponent, DslSearchSettingsComponent or MobileSearchSettingsComponent
      let componentFactory = this.componentFactoryResolver.resolveComponentFactory(searchSettingsComponent);
      this.searchSettingsComponent = this.searchContainer.createComponent(componentFactory);
      this.searchSettingsComponent.instance.comparisonSettings = comparisonSettings;
      this.searchSettingsComponent.instance.onSave.subscribe(settings => this.saveSearchSettings(settings));
  }
  </code></pre>
  
  <p>The <code>SearchComponent</code> is the routing component of the <code>search</code> route, which is a child route of my <code>contract</code> route, which gets lazy loaded. This again is a child route of my home route (also lazy loaded) and this belongs to the main route.</p>
  
  <h2>Environment</h2>
  
  <pre><code>Angular version: 5.2.4
  
  For Tooling issues:
  - Node version: 8.11.3
  - Platform:  Mac
  </code></pre>