While I have come across similar questions, I haven't been able to find a solution for my specific issue.
@Component({
selector: 'waiting',
template: `
<div class="waiting">
<div *ngIf="isLoading" class="loader2"></div>
<div>`
})
export class WaitingComponent {
public isLoading: boolean;
public constructor(private _authHttp: HttpService) {
this._authHttp.request.subscribe((action: HttpAction) => {
this.isLoading = action === HttpAction.Requested;//HttpAction.Requested returns 0 or 1
});
}
}
I've seen suggestions that the value of isLoading needs to be changed in AfterViewInit. However, I'm struggling to implement it successfully. Any help would be greatly appreciated.