Ipad Support - AfterViewInit not called


#1

While emulating my ionic 2 application on an ipad, the emulator never gets past the splash screen. After several hours of debugging, I have found that the lifecycle event ngAfterViewInit never gets called. Example

@Component({
  template: '<ion-nav hide-nav-bar="true" [root]="rootPage"></ion-nav>'
})
export class MyApp implements AfterViewInit {
  rootPage: any = LoginPage;

  constructor(public platform: Platform,
              public af: AngularFire,
              public menu: MenuController) {
    /* listen for login / logout event, change root page */
    this.platform = platform;
    platform.ready().then(() => {
      setTimeout( () => {
        console.log('Platform was ready 3s ago');
      }, 3000);
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.

  /* Cordova */
  StatusBar.styleDefault();

  // Keyboard 
  Keyboard.hideKeyboardAccessoryBar(false);
    this.menu = menu;
  }

  ngAfterViewInit() {
    console.log('ngAfterViewInit');
     this.listenToLoginEvents();
  }

   listenToLoginEvents() {
    // Do something here
  }
}

The platform.ready does get called though. Anyone found this issue? I build the package with

ionic build ios

And then emulate through xcode.