0

With Router V 3.0.0 I can do this

this.router.routerState.snapshot.root.queryParams["someParameter"];

Bu I can't achieve the same with Router V 3.4.10.

Any ideas?

vicmac
  • 645
  • 2
  • 6
  • 10

1 Answers1

0

Write in constructor of the component

constructor(private router: Router, private route: ActivatedRoute ) { this.route.queryParams.forEach((params: Params) => { let someParameter = params['someParameter']; console.log(someParameter); }); }

Aman Jain
  • 2,294
  • 1
  • 16
  • 22