Reputation: 1
I want to access the parameters from url in Angular 2. I use ActivatedRoute service instance which has the property of Params, Params has the property _value which has the parameters but when tried to access it in Visual Code couldn't why is that ?
Upvotes: 0
Views: 159
Reputation: 38713
Please take a look here and try this below.
this.activatedRoute.params.subscribe(params => {
this.id = params['id']; //Assume id is your parameter name
});
Upvotes: 1