title: How to get url before route in Angular 4
body: <p>Suppose I have two routes :</p>
  <pre><code>{ path: '/path1', component: component1 }
  { path: '/path2', component: component2 }
  </code></pre>
  <p>and I am at '/path1' and navigating to '/path2'.</p>
  <blockquote>
  <p>So my question is how get route url '/path1' in component 2 constructor or anywhere in code without using resolve or global variable through any service.</p>
  <p>Component2.ts</p>
  </blockquote>
  <pre><code>export class Component2{
      constructor(router: Router) {
          router.events.subscribe((event) =&gt; {
              // here I want to get route url '/path1' from component1
          });
      }
  }
  </code></pre>
  <p>Please let me know if anyone needs more clarification.</p>