Reputation: 23
When I push another page in my modal using this.navCtrl.push(TwoPage)
, the pushed page displays like this:
The modal was created as follows:
let modal = this.modalCtrl.create(OnePage);
modal.present();
Upvotes: 1
Views: 2365
Reputation: 35372
You should avoid to push directly from modal navigator, instead try to do:
constructor(
private appCtrl: App,
...
Then , in you method do:
this.appCtrl.getRootNavs()[0].push(YourNextPage);
Upvotes: 0
Reputation: 372
Just to update, getRootNav() is deprecated and now you have to use:
this.app.getActiveNav().push(TwoPage);
but this will be also deprecated and the recommendation is to use getActiveNavs() which returns an array of active NavControllers, so at your own risk you could use it this way:
this.app.getActiveNavs()[0].push(TwoPage);
Upvotes: 0
Reputation: 29614
Check the Navigating from an Overlay Component section in the Ionic doc
Try in your modal:
import { App, ViewController } from 'ionic-angular';
The constructor: Inject App
constructor(
public viewCtrl: ViewController
public app: App
) {}
Inorder to navigate,
this.app.getRootNav().push(TwoPage);
Upvotes: 5