title: How to insert a Angular service into a function in a Module file outside the class?
body: <p>I have some function in my <code>app.module.ts</code> file after Module class declaration</p>
  
  <pre><code>export function exportTranslateStaticLoader(http: HttpClient, config: RuntimeConfigLoaderService, transferState: TransferState, cookie: CookieService) {
    let apiUrl;
    if (environment.browser.symphonyApiUrl) {
      apiUrl = environment.browser.symphonyApiUrl;
    } else {
      const protocol = window.location.protocol;
      const host = window.location.host;
      apiUrl = `${protocol}//api.${host}`;
    }
    const link = environment.remoteTranslate ? `${apiUrl}/cms/locale/` : '/assets/i18n/';
    return new TranslateBrowserLoader(link, '.json', transferState, http, cookie);
  }
  </code></pre>
  
  <p>and use them in imports section </p>
  
  <pre><code>TranslateModule.forRoot({
        loader: {
          provide: TranslateLoader,
          useFactory: exportTranslateStaticLoader,
          deps: [HttpClient, TransferState, CookieService]
        }
      }),
  </code></pre>
  
  <p>I'm need use some service (<code>RuntimeConfigLoaderService</code>)  in this function, how do it ?</p>