title: Angular Router: Get route config that matched the current route
body: <p>I have the following route configuration in my Angular project:</p>
  
  <pre><code>export const routes: Routes = [
    { path: 'a/:id', loadChildren: './a/a.module#AModule', data: {a: a}},
    { path: 'b/:id',  loadChildren: './b/b.module#BModule', data: {a: b}}
  ];
  </code></pre>
  
  <p>Now I can get my route configuration like this:</p>
  
  <pre><code>this.router.config //outputs the above array
  </code></pre>
  
  <p>The <code>this.router.url</code> shows <code>a</code>, but how would I correctly identify the correct <code>Route</code> since the configuration has the unresolved path and the router holds the resolved path.</p>
  
  <p>The reason I want to do that is to access the <code>data</code> in the <code>app.component</code> where my <code>router-outlet</code> is and not in the component itself (the angular documentation says that the <code>data</code> object is only accessible to the route component itself.</p>