I'm using the Angular project and I want to hide a div when the value of a boolean varaible is loading = true. I assign the variable to false at the beginning,
ngOnInit(): void {
this.loading = false;
}
However, the div always is shown even the variable is false, not true
<div [hidden]="loading" id="loding_div">
{{loading}}
Loading the div...
</div>
You can [disabled] instead of[hidden] to hide the div.
<div [disabled]="loading" id="loding_div">
{{loading}}
Loading the div...
</div>