Ionic 2, Beta 11, NavController push is now broken
Hi
I've just updated to beta 11, hoping that it might fix the Popover problems I've been having on Android devices.
Sadly, the Beta 11 now seems to have broken my navigation. None of my this.nav.push(SettingsPage) commands now work.
Anyone else finding this or know what might be going wrong?
Cheers
Tom
Tom, I'm not having issues with nav.push in my project, can you provide a code snippet? We might spot your fault.
Hello @tomgallagher ! Thanks for opening an issue with us! Unfortunately i am also not able to reproduce any issues with the push() method of the NavController. Would you mind sharing a code snippet or repo that I can use to reproduce this issue? Thanks for using Ionic!
Thanks for getting back.
I have an app whose navigation has been working for months.
I upgraded to beta 11 and all the Nav push commands have stopped working in the browser.
There's nothing very complicated going on.
showSettings() { console.log("Clicked"); this._navController.push(SettingsPage); }
So either my move to beta 11 has not worked properly or something else is going on.
Thanks for the info! Did you follow our steps to update to update your app?
Yes I did. I went through all of my overlays and changed the syntax, they are all working just fine with the new beta, thanks for that. I have a tabbed app, so I've updated the tabs config variables.
Awesome! Unfortunately i still cannot seem to reproduce. Are you able to reproduce this issue outside of your app? For example, if you start a new starter using ionic start test-app --v2 could you try to reproduce it their? Unfortunately I am not able to reproduce with any of our test apps.
When I click to nav.push, the page gets pushed into the HTML, I can see it arrive in the browser console. It has a z-index of 101 against 100 for the underlay page, but it also has an opacity of 0 in the CSS rules. When I change the opacity, the page is there, no back button though.
@tomgallagher Ahh, it sounds like most likely you have some sort of error in your page that you are trying to push onto the stack that causes it to not get fully activated. Would you try reproducing this issue with a fresh project?
Well I can try with a fresh page in my app, that would be a sensible thing to try. I'll report back.
OK the fresh page works just fine so it's my problem. Thanks for the help.
@tomgallagher Thanks for testing ! I would check and make sure that you renamed all of your methods correctly when you did the upgrade to beta.11. Most ide's such as vscode have really nice search functions that should be able to help. Thanks for using Ionic!
Just one last thing, in your test apps, have you tried pushing pages to the NavController that include the new overlay syntax?
And can I just check the following syntax with you?
import {NavController, AlertController, PopoverController} from 'ionic-angular';
export class SettingsPage { static get parameters() { return [[NavController],[AlertController],[PopoverController],[DataStorage]]; }
constructor(_navController, _alertController, _popoverController, _dataStorage) { this._navController = _navController; this._alertController = _alertController; this._popoverController = _popoverController;
Thanks for your time.
@tomgallagher Yep! A few of my pages are using the new overlay component syntax. Quick question, are you using JavaScript or TypeScript?
Javascript
Ahh ok, unfortunately we do not support writing Ionic 2 apps in plain javascript anymore as of beta.9. Because of the immense advantages that Typescript gives you as an Ionic 2 developer we have decided to go all in on Typescript. You can read more about that decision here. I would recommend going to our forums as someone on their may still be using plain JavaScript. Thanks for using Ionic!
So are you saying that there may not be any bugs in the code I have written, it may simply not work because it's written in Javascript? This is tough on me because Javascript was the Ionic 2 default when I started writing the app four months ago, I've got years of experience writing Javascript and it will leave me with a massive retooling to do.
Hello @tomgallagher. Sorry, that is not what I am saying at all 😃 . It technically should still work fine, i am just not able to support it fully unfortunately because we do not officially support Ionic 2 apps written in JavaScript anymore. That is why i pointed you towards our forums. Thanks, and i hope that clears things up.
The errors in my pages are caused by ngModel. Nothing I have changed in the last 2 months. Have you seen anything about that recently, in connection with beta11?
This is the typical offending line in each page;
<ion-input [(ngModel)]="home_URL" id="homeURL" type="text"></ion-input>