title: Angular 5 ParamMap not working on app.component.ts
body: <p>I want to get id from route params but it return null as value. </p>
  
  <p>app.component.ts: </p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { ActivatedRoute } from '@angular/router';
  
  @Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.scss']
  })
  export class AppComponent implements OnInit {    
    constructor(private route: ActivatedRoute) { }
  
      ngOnInit(){  
      const id = this.route.snapshot.paramMap.get('idC');
      console.log(id);
  }
  </code></pre>
  
  <p>routing.ts: </p>
  
  <pre><code>{ path: 'profile/:idC', component: AccountComponent }
  </code></pre>
  
  <p>The aim of code on app.component is because I'm using navbar on app so when a user is connected, the expected result is to get id from route so that navbar will display "Welcome user1". Any solution ? </p>