In the HTML file, I have the following code:
<p *ngIf="!checklistsready">
not ready
</p>
<p *ngIf="checklistsready">
Ready
</p>
And in my TypeScript file, it looks like this:
checklistsready: boolean = false;
constructor(){
this.fetchChecks();
}
fetchChecks(){
this._checklistService.getAllchecks() //fetch data from http
.subscribe(
res=>{
console.log(res) //this displays the output
this.checklistsready = true;
}
)
}
I'm wondering what could be wrong since the page always displays "not ready"?