title: How to get parameters from the Angular ActivatedRoute
body: <p>I'm trying to get the prameter :id from my activated route using observables. When I print params on the console I get the right values for :id. But it's not the case for this.id. I get the value NaN.
  Can you tell me what is the problem</p>
  
  <pre><code>export class RecipeEditComponent implements OnInit {
    id: number;
    editMode = false;
  
    constructor(private route: ActivatedRoute) { }
  
    ngOnInit() {
      this.route.params.subscribe(
        (params: {id: string}) =&gt; {
          this.id = +params.id;
          console.log(this.id);
        }
      );
  }
  }
  </code></pre>