title: Retrieving the active component and path
body: <p>With Angular2, how would I retrieve the current active component and path?  </p>
  
  <p>For example I might have the following routes:</p>
  
  <pre><code>{ path: '', component: HomeComponent },
  { path: 'list', component: ListComponent },
  { path: ':id/', component: CustomComponent }
  </code></pre>
  
  <p>If I had navigated to <code>https://domain.com/test</code> is there a way to know I'm currently viewing the <code>CustomComponent</code> and to retrieve the id/path, which in this case is "test"?</p>
  
  <p>I could use <code>window.location.pathname</code> with regex to get the path but this is messy and still doesn't allow me to easily get the active component.</p>