export class MyApp {
root: Type = WelcomePage;
app:IonicApp;
constructor(app: IonicApp, events: Events, platform: Platform, authService:AuthService) {
this.app = app;
let t = setTimeout(() => {
let nav = this.app.getComponent('nav');
console.log(nav);
}, 100);
This code successfully gets the 'nav' component after a 100 ms delay. But if I remove the timeout, the getComponent call returns undefined. Using a timeout feels hackish, is there a better way to wait until the ion-nav component has been rendered before getting the component?