title: changing url dynamically in angular 4 depending upon the environments
body: <p>right now to change the url for angular 4 application i am using ng build--(name of the flag)
  for example if it is production i use ng build --prod</p>
  
  <p>what i want to achieve is for example-
  for  local host if the URL is -<a href="https://local.com/application/overview" rel="nofollow noreferrer">https://local.com/application/overview</a></p>
  
  <p>for  staging  it is - for my local host if the URL is -<a href="https://stage.com/application/overview" rel="nofollow noreferrer">https://stage.com/application/overview</a></p>
  
  <p>for  production the url is it is - for my local host if the URL is -<a href="https://prod.com/application/overview" rel="nofollow noreferrer">https://prod.com/application/overview</a>.</p>
  
  <p>i want to to change the hostname dynamically with me changing the url again and again. if the code is deployed to stage it should take the stage url and vice versa.</p>
  
  <p>how it can be achieved? any suggestion will be appreciated.</p>