Inside an *ngFor loop, I want an HTML element to randomly display itself...50/50 chance.
Here is what I thought would work:
<span *ngIf="Math.random() < 0.5">test</span>
But I get error:
BookingPageComponent.html:139 ERROR TypeError: Cannot read property 'random' of undefined
What am I doing wrong and how should it be done correctly?
Thanks!