title: Unable to access a route parameter through route.snapshot in root component
body: <p>I want to get token from url 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 token = this.route.snapshot.paramMap.get('token');
      console.log(token);
  </code></pre>
  
  <p>and routing.ts</p>
  
  <pre><code>{ path: ':token', component: AppComponent }
  </code></pre>
  
  <p>i want to grab contents after / in url eg: localhost:4200/content-to-grab
  any solutions?</p>