I have code in my app-component.ts
import {Nav} from 'ionic-angular';
...
@ViewChild(Nav) nav: Nav;
...
this.nav.setRoot(page.component, params)
.catch((err: any) => {
console.log(`Didn't set nav root: ${err}`);
});
Then in two separate pages:
let data = this.navParams.get('data');
console.log(data);
this.job = data;
- Page 1 (a modal), it works fine
- Page 2 (not a modal) data is undefined.
So I doing this instead to fix:
let data = this.navParams.data
and it works.
Here's a crazy debug screenshot to showcase how get is broken 'sometimes'!
Anyone else experienced this. Is there some glaring mistake I'm overlooking?