title: Injecting a Angular Service in the main.ts file
body: <p>Currently my <em>main.ts</em> file looks like this:</p>
  
  <pre><code>declare const require; 
  const translations = require("raw-loader!./locale/messages.de.xlf");
  
  platformBrowserDynamic().bootstrapModule(AppModule, {
    providers: [
      { provide: TRANSLATIONS, useValue: translations },
      { provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }
    ]
  });
  </code></pre>
  
  <p>Instead of hardcoding this <code>"raw-loader!./locale/messages.de.xlf"</code> I would like to use a service instead which provides this string, like for example:</p>
  
  <pre><code>const translations = require(translationService.localeString); //does not work!
  </code></pre>
  
  <p>Is there a possible way of doing this? I have already created a Service for that but I can't find a way to inject it into the main.ts file.</p>