Angular 2 - Show loading-information when (observableData | async) is not yet resolved
问题 just as the title says, I want to embrace the power of rxjs Observables. What I do now: // dataview.html <div *ngIf="isLoading">Loading data...div> <ul *ngIf="!isLoading"> <li *ngFor="let d of data">{{ d.value }}</li> </ul> // dataview.ts data: any[] = []; isLoading: boolean = false; getData() { this.isLoading = true; this._api.getData().subscribe( data => { this.data = data; this.isLoading = false; }, error => { this.error = error; this.isLoading = false; }); } What I want to do: 1. Use