title: How to inject a service into a constant in angular
body: <p>I'm trying to export a constant in angular and I need to set a key whose value will be returned from a service. I tried with following code:</p>
  <p>This is my user-config.ts file:</p>
  <pre class="lang-js prettyprint-override"><code>export const USER_CONFIG = {
      username: new UserService().getUsername()
  }
  </code></pre>
  <p>And this is my UserService file that I would like to be injected in constant:</p>
  <pre class="lang-js prettyprint-override"><code>export class UserService{
      constructor(someOtherService: SomeOtherService)
      getUsername() {
          return this.someOtherService.getDetails('some/url')
      }
  }
  </code></pre>
  <p>I'm not able to work around this problem.
  Need help.</p>