NavController.goForward() query params don't work
See original GitHub issueBug Report
Ionic Info
Ionic:
ionic (Ionic CLI) : 4.1.0
Ionic Framework : @ionic/angular 4.0.0-beta.2
@angular-devkit/core : 0.7.3
@angular-devkit/schematics : 0.7.3
@angular/cli : 6.1.3
@ionic/ng-toolkit : 1.0.6
@ionic/schematics-angular : 1.0.5
System:
NodeJS : v8.11.3
npm : 5.6.0
OS : Windows 10
Describe the Bug Query params passed via NavController.goForward() are not appended to the URL.
Steps to Reproduce
- Create starter app: ionic start myApp sidemenu --type=angular
- Add button to side menu (or anywhere), wire to following handler:
test(): void {
this.navController.goForward(`/list`, true, { queryParams: { dummy: 4 }});
}
Expected Behavior When clicking button, browser should navigate to “/list?dummy=4”. Instead it navigates to “/list” without query param.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:10 (3 by maintainers)
Top Results From Across the Web
NavController.goForward() Query Params - Ionic Framework
Attempting to pass query params via nav controller doesn't seem to work. Here is a simplified version of what I have. this.navController.
Read more >NavController.goForward() query params don't work #15219
Query params passed via NavController.goForward() are not appended to the URL. ... When clicking button, browser should navigate to "/list?dummy=4 ...
Read more >Ionic 4 - how to pass data between pages using navCtrl or ...
I have solved this by wrapping the Ionic NavController in a provider which has functions to set a value to a variable ...
Read more >Navigate to a destination - Android Developers
Navigating to a destination is done using a NavController , an object that manages app navigation within a NavHost .
Read more >Navigating in Jetpack Compose - Medium
To navigate when a button in our FeedScreen is clicked we added the NavController to the FeedScreen 's parameters. Finally, when the button...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sure, but then you lose the forward/back/root hints that Ionic (maybe) uses. Really I just want a clear answer from Ionic team on which we should be using going forward in an Ionic project.
Hello, I am using beta.12, and it works only if I use the URL as array:
this.router.navigate( [‘/list’] , { queryParams: { dummy: 4 }}); } WORKS this.router.navigate( ‘/list’ , { queryParams: { dummy: 4 }}); } NO QUERY PARAMS