0

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 ?

enter image description here

2
  • How are you accessing it? Commented Feb 26, 2018 at 7:35
  • angular.io/guide/… Commented Feb 26, 2018 at 7:38

1 Answer 1

1

Please take a look here and try this below.

this.activatedRoute.params.subscribe(params => {
this.id = params['id']; //Assume id is your parameter name                    
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.