I am making an angular2 application. My biggest problem is the inability to defer loading of main component's dependent child component till some promise gets resolved.
I have app.component.ts, with class named AppComponent, which I bootstrap in boot.ts like this:
bootstrap(AppComponent, [ROUTER_PROVIDERS, HTTP_PROVIDERS]);
Now I want to call few very vital http services before navigating to my default route, i.e-'/'. One http service returns data to me that will be used for doing SEO and setting meta data on various routes.
I know that the constructor of any class is called at first, but I don't know if the constructor waits for the promises to get resolved.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…