如何在IONIC 3中回到root应用程序

时间:2017-05-20 04:21:19

标签: ionic-framework ionic-view ionic3

如何在IONIC 3中返回root应用程序。

  

main.js:1436 ERROR错误:未捕获(在承诺中):无效链接:   TabsPage(...)

import { Component, ViewChild, ElementRef } from '@angular/core'; 
import { NavController } from 'ionic-angular'; 
import { Geolocation } from '@ionic-native/geolocation'



@Component({   selector: 'page-registrar',  
               templateUrl: 'registrar.html' 
}) 

 export class RegistrarPage {    
   constructor(public navCtrl: NavController) {}

   ionViewDidLoad(){}


  openHomePage(){
    this.navCtrl.setRoot('TabsPage');   
  }

}

1 个答案:

答案 0 :(得分:0)

试试这个this.navCtrl.popToRoot()

来自Ionic Doc。这将导航回堆栈的根目录,无论后面有多远。 Detail Link