Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

angular2 rc6: Property queryParams does not exist on type RouterState

Tags:

angular

Another "Deprecation-Now-Error" on the road to angular 2 final.

The error-message is clear, I just need to know what the corresponding field is called now. Anybody?

Property queryParams does not exist on type RouterState

like image 337
Tobias Gassmann Avatar asked Sep 06 '16 08:09

Tobias Gassmann


2 Answers

Think I solved it: The property "queryParams" is now on the property "root" of the Routerstate:

this.router.routerState.root.queryParams
like image 156
Tobias Gassmann Avatar answered Oct 14 '22 17:10

Tobias Gassmann


Probably u are using:

router: Router

You can change that to:

activatedRoute: ActivatedRoute

Then to access the queryParams:

this.activatedRoute.queryParams
like image 43
stijn.aerts Avatar answered Oct 14 '22 19:10

stijn.aerts