title: Access route data from directives in angular2
body: <pre><code>const APP_ROUTES: RouterConfig = [
  
      {
  
          path: 'app/home',
          component: HomeComponent,
          data: {
            name: 'Home'
          }
  
      }
  
  
  ]
  </code></pre>
  
  <p>If I have route configuration shown as above how do I access its <code>data</code> property from some directive.</p>
  
  <pre><code>@Directive({
    name: 'hello'
  })
  
  class HelloDirective {
   @Input('routerLink') link: string[];
  
   ngOnInit() {
      //HOW CAN I GET ROUTE AND ITS DATA FROM PATH/URL ???
  
      //const magicallyGrabbedRoute = pleaseGiveMeMyRouteFrom(this.link);
      //const myData = magicallyGrabbedRoute.data;
  
   }
  
  }
  
  &lt;a hello [routerLink]="['app/home']"&gt; Go Home &lt;/a&gt;
  </code></pre>
  
  <p>In <code>hello</code> directive how can I get route configuration for the <code>routerLink</code> attribute's value ?</p>