title: How do I get the entryComponents dynamically using import() method of Typescript 2.4
body: <p><code>Typescript 2.4</code> introduce <code>[import()][1]</code> method to load modules dynamically. I am trying to load components dynamically using the following mentioned procedure <a href="https://angular.io/guide/dynamic-component-loader" rel="nofollow noreferrer">https://angular.io/guide/dynamic-component-loader</a> where we need to mention <code>entryComponents</code> in the module.
  I am able to load all component modules dynamically using <code>import()</code> method in the AppModule but I am not able to get <code>entryComponents</code> of the modules. For example,
  I have a component and its module</p>
  <p>data-widget.component:</p>
  <pre><code>@Component({
     selector: 'data-widget',
     templateUrl: 'data-widget.component.html'
     })
     export class DataWidget{}
  </code></pre>
  <p>and
  data-widget.module.ts</p>
  <pre><code>@NgModule({
    imports: [ ...,
    declarations: [DataWidget],
    exports: [DataWidget],    
    providers:    [],
     entryComponents: [DataWidget]               
  })
  export class DataWidgetModule {
      constructor(private widgetService: widgetService) {
        widgetService.register('weather', DataWidget);   
      }        
   }
  </code></pre>
  <p>I am now able to load that module dynamically using <code>import()</code> method in the following way</p>
  <p>app.module.ts</p>
  <pre><code>@NgModule({
    imports: [ ...,
    declarations: [],
    exports: [],    
    providers:    []
   
  })
  export class AppModule {
      constructor(private apiService: apiService) {
        apiService.getMoudleUrls().subscribe( data=&gt;{
             import(''+data); //e.g './data-widget/data-widget.module'    
        },
        error=&gt;{});
      }        
   }
  </code></pre>
  <p>In AppModule module the DataWidgetModule loaded in Webpack dynamically.Now I am trying to load DataWidget Component dynamically. You can see that I have register the component in <code>DataWidgetModule</code> using <code>widgetService</code>. But this function was not called during module loading as well as the entryComponents are also not loaded. So, when I tried to load the component using the following way which I have mentioned above</p>
  <p><code>this.componentFactoryResolver.resolveComponentFactory(widgetService.getRegisteredWidget());</code></p>
  <p>then I am getting error as <code>entryComponents</code> are not loaded in @ngModule. How can I load the entryComponents and register the components for dynamic load? It will be very helpful to get a solution for it. Thank you.</p>