Ionic version: (check one with "x")
[ ] 1.x
[X] 2.x
I'm submitting a ... (check one with "x")
[X] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/
Current behavior:
The documentation lists NavController.setPages() to take an array of pages with their params as the first argument. However, there is no example of doing this and I cannot, for the life of me, figure it out.
Expected behavior:
import {HelloPage} from "pages/hello";
[...]
// works as expected
let options = {name: "Bill"};
this.navController.setRoot(HelloPage, options);
// how would I pass the params in setPages?
this.navController.setPages([GoodbyePage, HelloPage]);
this.navController.setPages([GoodbyePage, HelloPage], options); // doesn't work
this.navController.setPages([GoodbyePage, [HelloPage, options]]); // what I expected to work but doesn't
I think I figured it out but only after pouring through the source code. There are no easy examples online, anywhere.
this.navController.setPages([GoodbyePage, {page: HelloPage, params: options}]);
THX for this save my day
This issue was moved to driftyco/ionic-site#970
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Most helpful comment
I think I figured it out but only after pouring through the source code. There are no easy examples online, anywhere.