ionic-team / ionic-v3

The repo for Ionic 3.x. For the latest version of Ionic, please see https://github.com/ionic-team/ionic
Other
128 stars 85 forks source link

Lifecycle events not being triggered when using side menu with menu-tabs inside #612

Open ionitron-bot[bot] opened 5 years ago

ionitron-bot[bot] commented 5 years ago

Original issue by @federhico on 2018-04-09T15:33:06Z

Ionic version: (check one with "x") (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1) [ ] 2.x [X] 3.9.2 [ ] 4.x

I'm submitting a ... (check one with "x") [X] bug report [?] feature request

Current behavior: When i push() some page from side-menu and the actual page is one that have menu-tabs, the ionViewWillLeave & ionViewDidLeave events are not fired

Expected behavior: if i push a page the events must be fired

Steps to reproduce:

Related code: Working on reproduce the behaviour in conference-app

RELATED: #9951

Hamidaraghi commented 5 years ago

In side menu define your nav controller variable like this:

export class Menu {
...
  @ViewChild("content") childNavCtrl: NavController;
...
constructor(...){
}

  openPage(pageName) {
    this.childNavCtrl.push('pageName');
  }