I am attempting to configure this Angular/Html/JS so that the elements begin to have a blue background when counter >= 5
<p
*ngFor="let log of clickLog"
[ngStyle]="{backgroundColor: counter >= 5 ? 'blue' : 'transparent'}">
{{ log }}
</p>
when the counter is <= 4, all elements have no styling, as intended. The problem is: once the counter hits 5, ALL elements take on the blue background. My intention is that only elements 5+ have the background.
Edit: I am aware that I can use an index value from the ngFor-loop as an alternative solution. I am specifically curious why this approach does not work.