Emanuel Weinsjö Emanuel Weinsjö - 1 month ago 9
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?

<div *ngIf="data">
http.get(...).subscribe(val => this.data = val);