-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rootParams in ion-nav not returning data #9714
Comments
this is happening to me as well... |
Hi @warent since it's still not working, I tried in this doc http://ionicframework.com/docs/v2/api/navigation/NavController/ the Navigating from the Root component . Maybe this can help you too. |
This is still an issue in Ionic 3.0.1 |
can someone provide a small plunker or repo that reproduces the issue? |
@manucorporat Reproducing this is really trivial. @zuna003 provided reproduction steps |
FYI this is working as expected, however the timing is off. Going back to the original example, if you wait (e.g. 1.5 seconds) from setting, to navigating to the second page, the navparams value is there. If you navigate immediately, it is not. It doesn't appear to be a zone thing. [Timings from actual device] |
@manucorporat I found the solution for this issue. In line I changed it from +Adding a linked issue #6530 |
@aggarwalankush I created a PR with your solution. |
@danielsogl This is not a good solution. I tried to point out the problematic code. As both A good solution would be taking below logic out of setter and put somewhere else. Might be in
|
@danielsogl @manucorporat instead of setting
Let me know if it's the good solution. |
So I got it working with the following code (see below). I'm facing the same issue as @alexbainbridge described: sometimes calling Anyone has any idea what's causing this? Is there another solution/workaround that ensures data is passed into the tabbed page every time? The inconsistency is frustrating and unacceptable when running the app in production. Login.ts
Tabs.ts
Tabs.html
Dashboard.ts
|
i am facing the same issue. My app.html is |
@amirhammad: i have a similar issue: it's working fine the first time. but if you change the value
step 1: set |
What helped me was to move my
|
Still had this problem and the workaround for me was to not rely on the 'rootPrams' property in the it just didn't work for me. What DID work for me was: WelcomePage: The trick was to explicitly call setRoom in app.component.ts versus relying on the name matching from . |
This issue has been automatically identified as an Ionic 3 issue. We recently moved Ionic 3 to its own repository. I am moving this issue to the repository for Ionic 3. Please track this issue over there. If I've made a mistake, and if this issue is still relevant to Ionic 4, please let the Ionic Framework team know! Thank you for using Ionic! |
Issue moved to: ionic-team/ionic-v3#152 |
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:
Passing data in rootParams
Expected behavior:
Return data
Related code:
Page 1:
this.test = {x: 'For Testing'};
<ion-nav [root]="rootPage" [rootParams]="test"></ion-nav>
Page 2:
console.log(this.navParams); // no return data
or
console.log(this.navParams.get('x')); // no return data
Ionic info:
System information:
Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.4
Ionic CLI Version: 2.1.17
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 0.0.47
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 7
Node Version: v6.9.1
Xcode version: Not installed
The text was updated successfully, but these errors were encountered: