title: Different routes same component in Angular 7
body: <p>I use the same component for different routes but when I navigate between routes of the same component the URL is getting changed but page content is the same. </p>
  
  <p>I used this solution:</p>
  
  <pre><code>constructor(route:ActivatedRoute) {
    route.url.subscribe(val =&gt; {
       //Code Here
    });
  }
  </code></pre>
  
  <p>I now have the expected behavior but another problem: Angular does not save the previous URL in the browser history.</p>
  
  <p>If the flow is: A -> B -> C where B and C are the same component, if I click on the back button in the browser, I navigate to A instead of B.</p>