When I call this.navCtrl.popAll();
, I get this error:
Error: Uncaught (in promise): navigation stack needs at least one root page
But the root page is set in app.component.ts
:
rootPage = LandingPage;
What is still missing?
When I call this.navCtrl.popAll();
, I get this error:
Error: Uncaught (in promise): navigation stack needs at least one root page
But the root page is set in app.component.ts
:
rootPage = LandingPage;
What is still missing?
I have the same issue
Error: Uncaught (in promise): navigation stack needs at least one root page
... when I use registerbackbutton
for hardware back button in Android. And then I try to call this.navCtrl.pop()
for back to previous page.
My solution:
In app.component.ts
import { App } from 'ionic-angular/components/app/app';
/* define in constructor */
constructor(public platform: Platform, app: App){
this.platform.ready().then(() => {
this.platform.registerBackButtonAction(() => {
app.navPop();
});
})
}