When you check just for variable then this code is enough
<div class="someComponent" *ngIf="someVariable">
But how can I use a specific component of array instead of variable?
for example I want to check for array component someArray[]
using idVar someArray[idVar]
?
How can I put this inside ngIf?
I have in my ts file someArray: Boolean[];
then in my template I have some loop where I constract divs with *ngIf="someArray[idVar]"
because someArray has actual arguments for this moment there was error Cannot read property '1' of undefined
then I wrapped everything in
<ng-container *ngIf="someArray">
so when I load the page , because someArray do not exists everything works fine.
but then I have button on press I transfer 1 to ts file and put 'true' value to someArray[1]. When I do so script goes on error Cannot read property '1' of undefined