mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-24 06:22:45 +08:00
fix(nav): register child nav when created from modal
This commit is contained in:
@ -81,9 +81,15 @@ export class Nav extends NavControllerBase implements AfterViewInit {
|
||||
// this Nav has a parent Nav
|
||||
parent.registerChildNav(this);
|
||||
|
||||
} else if (app) {
|
||||
} else if (viewCtrl && viewCtrl.getNav()) {
|
||||
// this Nav was opened from a modal
|
||||
this.parent = viewCtrl.getNav();
|
||||
this.parent.registerChildNav(this);
|
||||
|
||||
} else if (app && !app.getRootNav()) {
|
||||
// a root nav has not been registered yet with the app
|
||||
// this is the root navcontroller for the entire app
|
||||
this._app.setRootNav(this);
|
||||
app.setRootNav(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user