Emanuel Weinsjö Emanuel Weinsjö - 1 year ago 148
TypeScript Question

Angular 2 - How can I block GUI rendering while waiting on http request to finish

It's possible to wait rendering the GUI/components and show it when the task has finish.


  1. Request the website in brwoser.

  2. Start a task loading some data from server.

  3. When task has finish tell angular2 to continue loading in all components.

  4. Rendering finish.

<div *ngIf="UserData">
<div *ngIf="!UserData">

So blocking top component, all componets in the moudle will be blocked?

Answer Source
<div *ngIf="data">
http.get(...).subscribe(val => this.data = val);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download