title: Angular 2 and Team City Production/Environment Variables
body: <p>We have a new Angular app that is building AOT to a folder. Everything is working fine, but we are trying to configure it to a five-step build process using TeamCity/Octopus Deploy, where each step will use some different variables for endpoints (API calls, etc.) I'm trying to figure out the best way to pass this to an AOT app that is not running off a backend. </p>
  
  <p>I know about the <code>--environment</code> flag that can be used to fire off different configs, but our goal is to have <em>one single</em> build go through all the environments. I am at a loss for how to pass variables in the application based on the environment it's in.</p>
  
  <p>My current idea is to leave a <code>config.js</code> file in the <code>assets</code> folder so the app can load it before the rest of the app and set some variables on the window, but that leaves me with the problem of not being able to import a TS file into the files that need those variables.</p>
  
  <p>How can I pass this info into the app in a more intuitive way? Is this impossible to get around without separate builds?</p>