Can somebody help me to resolve this issue in Ionic 3.
“Navigation stack needs at least one root page”
i am facing this error when i am trying to access followers-details page.
my followers.ts file code is .
import { Component } from '@angular/core'; import { IonicPage, NavController, NavParams } from 'ionic-angular'; import { ProfilePage } from '../profile/profile'; import { ProfileDetailsPage } from '../profile-details/profile-details'; import { FollowerDetailsPage } from '../follower-details/follower-details'; @IonicPage() @Component({ selector:'page-followers', templateUrl:'followers.html', }) export class FollowersPage{ constructor(publicnavCtrl:NavController, publicnavParams:NavParams) { } ionViewDidLoad() { console.log('ionViewDidLoad FollowersPage'); } followersDetails(){ this.navCtrl.push(FollowerDetailsPage); }
}
please give me suggestions to fix this error.
i encountered same error when i am trying to add back button with click directives.
in order to resolve this issue you need to follow this 2 steps.
step 1 . import that page class in app.module.ts
step 2 . make sure are have reference page in order to get that page on click method or any event.
for e.g suppose i am visiting page B from page A and from there we are popping back to the reference page A then we should make sure our root page is page A not page B.
Question and answer is powered by AnsPress.io