title: Angular :: Enviroment file fetch propery error
body: <p>Im new to Angular2, I have added some API configurations in environment file,its not giving any exception during compile time but getting exception at run time.</p>
  <pre><code>import { environment as defaultEnvironment } from './environment.defaults'
  
  export const environment = {
    ...defaultEnvironment,
    production: false,
    apiService: {
      serviceUrl: defaultEnvironment.baseURL + &quot;TestService/&quot;,
      getCompanies: this.serviceUrl + &quot;GetCompanies&quot;,
    }
  };
  </code></pre>
  <p>At run time when its fetching value of serviceUrl in getCompanies, im getting exception &quot;<strong>Uncaught TypeError: Cannot read property 'serviceUrl' of undefined</strong>&quot;</p>
  <p>Can anyone help to know why this is happening ? Thanks</p>