title: AngularJs Environment variables (API URL)
body: <p>Recently I have been working with Angular5 using <a href="https://cli.angular.io/" rel="nofollow noreferrer">Angular Cli</a> and one of the many things I like is the environment variables file located:</p>
  
  <blockquote>
    <p>src/environments</p>
  </blockquote>
  
  <p>Here there are two files <code>environment.prod.ts</code> and <code>environment.ts</code>. One of mine looks like this:</p>
  
  <pre><code>// The file contents for the current environment will overwrite these during build.
  // The build system defaults to the dev environment which uses `environment.ts`, but if you do
  // `ng build --env=prod` then `environment.prod.ts` will be used instead.
  // The list of which env maps to which file can be found in `.angular-cli.json`.
  
  export const environment = {
    production: false,
  
    apiUrl: 'http://intel-api-interactivechoices.azurewebsites.net'
    //apiUrl: 'http://localhost:61006'  
  };
  </code></pre>
  
  <p>I would like to use something similar in AngularJS but so far, I have been unable to find a suitable solution.
  Everything I try does not seem to do what I want.</p>
  
  <p>Does anyone know of a way of achieving this?</p>