title: Error: Uncaught (in promise): navigation stack needs at least one root page
body: <p>Im having an issues to save a data. It says </p>
  
  <p>Runtime Error: Uncaught (in promise): navigation stack needs at least one root page</p>
  
  <p><strong>this is my app.component.ts</strong></p>
  
  <pre><code>import { Component, ViewChild } from '@angular/core';
  import { Platform, NavController, MenuController } from 'ionic-angular';
  import { StatusBar } from '@ionic-native/status-bar';
  import { SplashScreen } from '@ionic-native/splash-screen';
  import firebase from 'firebase';
  
  //import { SearchPage } from '../pages/search/search';
  import { AppointmentPage } from '../pages/appointment/appointment';
  import { TabsPage } from '../pages/tabs/tabs';
  import { AuthServices } from '../provider/auth.service';
  import { LoginPage } from '../pages/login/login';
  import { SignUpPage } from '../pages/sign-up/sign-up';
  
  
  @Component({
    templateUrl: 'app.html'
  })
  export class MyApp {
    rootPage:any = TabsPage;
    AppointmentPage: AppointmentPage;
    LoginPage =LoginPage;
    SignUpPage = SignUpPage;
    isAuthenticated = false;
  
  @ViewChild('nav') nav: NavController;
  
    constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen, 
                private authService: AuthServices,
                private menuCtrl: MenuController,) {
      firebase.initializeApp({
      apiKey: "AIzaSyCearIrLYBjHJCq46MOXAlw-fnmm5loS6U",
      authDomain: "mydatalogin-3ed97.firebaseapp.com",
      });
  
      firebase.auth().onAuthStateChanged(user =&gt; {
        if (user){
          this.isAuthenticated = true;
          this.nav.setRoot(this.rootPage);
        }
        else{
          this.isAuthenticated = false;
          this.nav.setRoot(this.LoginPage);
        }
      });
  
      platform.ready().then(() =&gt; {
        // Okay, so the platform is ready and our plugins are available.
        // Here you can do any higher level native things you might need.
        statusBar.styleDefault();
        splashScreen.hide();
      });
    }
      onLoad(page: any){
      this.nav.setRoot(page);
      this.menuCtrl.close();
    }
  
    onLogout(){
      this.authService.onLogout();
      this.menuCtrl.close();
    }
  }
  </code></pre>
  
  <p><strong>this is the form.ts</strong></p>
  
  <pre><code>import { Component } from '@angular/core';
  import {  NavController, ViewController } from 'ionic-angular';
  
  @Component({
    selector: 'page-appointment',
    templateUrl: 'appointment.html',
  })
  export class AppointmentPage {
    fname: string;
    pno: string;
    today: Date;
    time: string;
    boutique: string;
    planner: string;
    halls: string;
    catering: string;
    services: string;
    message: string;
  
    constructor(public navCtrl: NavController, public view: ViewController) {
    }
  
  saveItem(){
  
      let newItem = {
        boutique: this.boutique,
        planner: this.planner,
        halls: this.halls,
        catering: this.catering,
        services: this.services,
  
        today: this.today,
        fname: this.fname,
        pno: this.pno,
        time: this.time,
        message: this.message,
  
          }
     console.log('saved item: ', newItem);
      this.view.dismiss(newItem);
    }
  
      }
  </code></pre>
  
  <p>I have tried refreshing all the files and the browser but it still couldnt save the data. i only use firebase for the logins and for saving data i used ionic storage.. </p>