title: Angular ActivatedRoute data returns an empty object
body: <p>I have a route registered with some data:</p>
  
  
  
  <pre class="lang-js prettyprint-override"><code>const routes: Routes = 
  [
      {path: 'my-route', data: { title: 'MyTitle' }, component: MyComponent},
  ];
  </code></pre>
  
  <p>and I'm trying to access to the route's data using <code>ActivatedRoute</code>:</p>
  
  <pre class="lang-js prettyprint-override"><code>import { Component, OnInit } from '@angular/core';
  import { ActivatedRoute } from '@angular/router';
  
  @Component({...})
  export class MyComponent implements OnInit {
    private routeData;
  
    constructor(private route: ActivatedRoute) {}
  
    ngOnInit() {
      this.routeData = this.route.data.subscribe((data) =&gt; {
        console.log(data); // this is returning an empty object {}
      });
    }
  }
  </code></pre>
  
  <p>but for some reasons <code>data</code> is an empty object.</p>
  
  <p>How to solve this problem?</p>