title: ActivatedRoute is showing null
body: <p>trying to get the data from router in different component. 
  but its showing <code>{}</code> value.</p>
  
  <p><strong>app-routing.module.ts</strong></p>
  
  <pre><code>{
    path: '',
    loadChildren: './pages/pages.module#PagesModule',  
  },
  </code></pre>
  
  <p><strong>pages-routing.module.ts</strong></p>
  
  <pre><code>path: 'namescan',
          component: NamescanComponent,
          data: { title: 'Name Title' }
  </code></pre>
  
  <p><strong>header.component.ts</strong></p>
  
  <pre><code>private routeData;
  constructor(public router: Router, public activatedRoute: ActivatedRoute) {    
  }
  
  ngOnInit() {
      this.activatedRoute.data.subscribe(data =&gt; console.log(data.title));    
  }
  </code></pre>
  
  <p>even find the smiliar question and even try to update the code but still not working 
  <a href="https://stackoverflow.com/questions/45737375/angular-activatedroute-data-returns-an-empty-object">Angular ActivatedRoute data returns an empty object</a></p>
  
  <p>any idea, how to get the data value from router. TIA</p>