title: Dynamically import modules into module based on `forRoot` config
body: <p>I have a module that uses <code>AgmCoreModule</code>. It takes the <code>apiKey</code> applied on the <code>forRoot</code> and adds it <code>AgmCoreModule</code> via <code>LAZY_MAPS_API_CONFIG</code>:</p>
  <pre class="lang-js prettyprint-override"><code>...some_module.ts
  
  export const AgmCoreModuleForRoot = AgmCoreModule.forRoot()
  
  
  imports: [
   AgmCoreModuleForRoot,
  ]
  providers: [
      {
        provide: LAZY_MAPS_API_CONFIG,
        useClass: GoogleMapsConfigService,
        deps: [GoogleMapsConfigServiceConfig],
      },
    ],
  
  export class SomeModule {
    static forRoot(
      config?: GoogleMapsConfigServiceConfig,
    ): ModuleWithProviders&lt;SomeModule&gt; {
      return {
        ngModule: SomeModule,
        providers: [{ provide: GoogleMapsConfigServiceConfig, useValue: config }],
      };
    }
  }
  </code></pre>
  <p>The module is mostly made of components that do not need <code>AgmCoreModule</code> so <code>SomeModule</code> can be imported with a blank forRoot like <code>SomeModule.forRoot()</code>.</p>
  <p>However, I'm running into issues using <code>SomeModule</code> with applications that have <code>AgmCoreModule</code> imported in a higher module say <code>App.module</code>. And that overrites the <code>AgmCoreModule</code>'s <code>forRoot</code>.</p>
  <p>example:</p>
  <pre class="lang-js prettyprint-override"><code>...app.module
  imports:[
  AgmCoreModule.forRoot({
        apiKey: environment.googleApiKey,
        libraries: ['places'],
      }),
  
  ...downstream.module.ts
  imports: [
  SomeModule.forRoot() &lt;-- This overwrites the above apiKey making the google places api not work
  
  </code></pre>
  <p>I would like to have the flexibility to conditionally load the <code>AgmCoreModule</code> based on the existence of an apiKey in the <code>forRoot</code> of <code>SomeModule</code>.</p>
  <p>Is this even a thing?</p>