I am having a div element having id attribute set as “hot”.
I am using Angular.
In the ts file I get the element by accessing the id through document.getElementById(‘hot’)
Now till I am reciving the data from API I dont want to display the table and therefore I am holding a boolean variable named “loading” which is set from true to false on reciving the data through API.
I have applied “ngIf " (angulars attribute) to the div element which is *ngIf=”!loading"
The issue is though after getting the data having the loading boolean is set false, that means ngIf would satisfy and div would be visible but after this the place where I am accessing the div with id is not able to look through that element in DOM.
Have a look here: https://stackblitz.com/edit/handsontable-angular-yctsxw?file=app%2Fapp.component.ts,app%2Fapp.component.html