angular - Angular2 - How do I delay initial load until service completes? -
i have angular2 rc6 application , need defer loading pages until after functionality executed.
i have service determines uri webapi. need application wait until url determined before tries load data. if hide main application in app.component, *ngif, routing errors because router outlet not exists.
before rc5/6 manually bootstrapped application after service get's uri.
if use router can use canactivate
, canactivatechild
.
see
- https://angular.io/docs/ts/latest/guide/router.html#!#guards
- resolve value *before* activating route in angular 2
- angular2 canactivate() calling async function
for loading once before app initialization can use app_initializer
explained in how pass parameters rendered backend angular2 bootstrap method
Comments
Post a Comment