title: this.route.snapshot.params.get is not a function
body: <p>I am new to Angular.I am building an Angular app and I want to get a parameter from the component route. I only have 1 component. So, when I go to <strong>localhost:4200</strong>I want to open my component, but when I go to <strong>localhost:4200/v1/5</strong> I want my component to open and to grab number 5 and then console.log it. I get the error from the title and I dont know why:</p>
  <p>app.component.ts:</p>
  <pre><code>import { Component, OnInit, AfterViewInit, Input, Output, EventEmitter, ViewChild, NgModule } from '@angular/core';
  import { RacvaService } from './racva.service';
  import {Router} from '@angular/router';
  import { ActivatedRoute } from '@angular/router';
  import { RouterModule, Routes } from '@angular/router';
  
  @Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.css']
  })
  
  
  export class AppComponent implements OnInit{
    title = 'RacveApp1';
    event:any;
    public racva: any;
  
    constructor(private route: ActivatedRoute){}
  
    ngOnInit(){
      let racva_id = parseInt(this.route.snapshot.params.get('id'));
      this.racva = racva_id;
      console.log(this.racva);
      }
    }
  }
  </code></pre>
  <p>app-routing.module.ts:</p>
  <pre><code>import { NgModule } from '@angular/core';
  import { RouterModule, Routes } from '@angular/router';
  import { AppComponent } from './app.component';
  
  const routes: Routes = [
    { path: 'v1/:id', component: AppComponent}
  ];
  
  @NgModule({
    imports: [RouterModule.forRoot(routes)],
    exports: [RouterModule]
  })
  
  export class AppRoutingModule { }
  
  export const routingComponents = [ AppComponent ];
  
  </code></pre>
  <p>app.module.ts:</p>
  <pre><code>import { NgModule } from '@angular/core';
  import { BrowserModule } from '@angular/platform-browser';
  import { AppRoutingModule } from './app-routing.module';
  import { AppComponent } from './app.component';
  import { FormsModule } from '@angular/forms';
  import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
  import {NgbPaginationModule, NgbAlertModule} from '@ng-bootstrap/ng-bootstrap';
  @NgModule({
    declarations: [
      AppComponent
    ],
    imports: [
      BrowserModule,
      AppRoutingModule,
      FormsModule,
      AppRoutingModule,
      HttpClientModule,
      NgbPaginationModule,
      NgbAlertModule
    ],
    providers: [],
    bootstrap: [AppComponent]
  })
  export class AppModule { }
  </code></pre>