Caio Franco Barreiro
Caio Franco Barreiro

Reputation: 61

Ionic 3 - Set Root without tabs

How to do a navCtrl.setRoot(Page) without the tabs?

I foun a solution for Ionic2 but can't find it to the version 3.

this.navCtrl.setRoot(LoginPage);

Upvotes: 2

Views: 3805

Answers (2)

nncl
nncl

Reputation: 128

import { NavController, App } from 'ionic-angular';

constructor(public app: App){}

// On your method, add code below
this.app.getRootNav().setRoot(SigninPage)

Upvotes: 4

Alif Jamaluddin
Alif Jamaluddin

Reputation: 518

To show your page without tabs you need to get root of your navCtrl by using getRootNav() method.

import { NavController, App } from 'ionic-angular';

constructor(public navCtrl: NavController, public app: App){
}

any_method(){
this.app.getRootNav(Page);
}

More details of this can be read from this documentation: Navigating from an overlay component

Upvotes: 0

Related Questions