title: Initialize other provider after APP_INITIALIZE
body: <p>I have a little bootstrapping problem using Angular 4. 
  I have a config file (json) that I'm loading from the server as my application starts (see also <a href="https://stackoverflow.com/questions/40075781/angular-2-get-config-from-server-before-bootstrap/40075846#40075846">here</a>). This works so far.</p>
  
  <p>Now I have a <a href="https://github.com/MarkPieszak/angular-application-insights" rel="noreferrer">dependency</a> that requires config values to be passed in a forRoot method. The implementation looks like this:</p>
  
  <pre><code>static forRoot(config: AppInsightsConfig): ModuleWithProviders {
      return {
          ngModule: ApplicationInsightsModule,
          providers: [
              { provide: AppInsightsConfig, useValue: config }
          ]
      };
  }
  </code></pre>
  
  <p>My Idea was to import the module without forRoot(), but providing the AppInsightsConfig by after the configs (from server) have been loaded.</p>
  
  <pre><code>@NgModule({
      bootstrap: sharedConfig.bootstrap,
      declarations: [...sharedConfig.declarations],
      imports: [
          BrowserModule,
          FormsModule,
          HttpModule,
          ApplicationInsightsModule,
          ...sharedConfig.imports        
      ],
      providers: [
          { provide: 'ORIGIN_URL', useValue: location.origin },
          { provide: 
              APP_INITIALIZER, 
              useFactory: (configService: ConfigService) =&gt; () =&gt; configService.load(), 
              deps: [ConfigService], multi: true 
          },
          { provide: 
              AppInsightsConfig, 
              useFactory: (configService: ConfigService) =&gt; { 
                  // outputs undefined, expected it to have the config
                  console.log(configService.config); 
                  return { instrumentationKey: 'key from config' } 
              },
              // My idea was, if I add APP_INITIALIZER as dependency,
              // the config would have been loaded, but this isn't the case.
              deps: [APP_INITIALIZER, ConfigService] 
          },
          AppInsightsService
      ]
  })
  </code></pre>
  
  <p>How can I provide AppInsightsConfig or another service AFTER my configs have been loaded?</p>