title: How to change URLs automatically in services, after changing URL it should affect to all components without saving/ building/running in angular6
body: <p>We are hosting a new application with angular 6 and we have many servers with diff URLs, i want to change them automatically(like .property file in java). after searching in google i got some answers like changing paths in environment.ts file, so it will affect to all components. but its not exactly my requirements, means if i change URL in environment.ts file, we should save the file and we need to compile it once again. So exactly this is the problem i am facing, i don't want to save / compile the file. </p>
  
  <p>Please help me in this situation.</p>
  
  <p>service.ts file.</p>
  
  <pre><code>emplLoginCheckUrl = this.baseUrl+"/checkValidUser";
  </code></pre>
  
  <p>i tried to change base url from environment.ts file, its working correctly but after saving the file, i dont want want save file it should change automatically.</p>
  
  <p>.service.ts file.</p>
  
  <pre><code> emplLoginCheckUrl = this.baseUrl+"/checkValidUser";
  
         validateUserDetails(employeeDetails): Observable&lt;any&gt; {
              console.log(this.baseUrl);
              return this._httpClinet.post(this.emplLoginCheckUrl, employeeDetails);
          }
  </code></pre>
  
  <p>environment.ts file.</p>
  
  <pre><code>export const environment = {
    production: false,
    baseUrl: "http://rest/somerestservice"
  };
  </code></pre>
  
  <p>Expected:</p>
  
  <p>URLs should change automatically without saving/running/compiling/building again and again, because only one time I can do saving/running/compiling/building while hosting. after hosting if I want to change URLs I can't go there, change the path and cant compile it once again.</p>