title: Angular 6 - Display variable on URL
body: <p>I am trying to solve a problem here.</p>
  
  <p>I need to display a variable on the URL of my Angular App like this:</p>
  
  <p>If <code>variable</code> is for example <code>test</code> I want to display the URL as <code>localhost:xxxx/test</code> and if the <code>variable</code> is changed to <code>something</code> the URL should be <code>localhost:xxxx/something</code> . I have read the Angular documentation but I was unable to find a related section, it's always about parsing data from the URL not injecting data to it. </p>
  
  <p>Can someone point me to the right direction?</p>