fix(nav): register child nav when created from modal

This commit is contained in:
Adam Bradley
2016-08-04 11:49:18 -05:00
parent 3977928048
commit 61a86253a8
3 changed files with 30 additions and 21 deletions

View File

@ -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);
}
}