Check out this StackBlitz demo
I have a simple view where I'm looping over HTML using Angular's *ngFor directive. To show more or less content, I'm using the ngx-bootstrap collapse component. The problem is that when I collapse one button, all of them collapse or expand.
To address this issue, I added an index variable in the *ngFor loop to keep track of each button, like so: isCollapsed[i]. The indexing works correctly.
In my .ts file, I initially declared isCollapsed as true, but I encountered an error saying "Cannot create property '1' on boolean 'true'." When I changed it to isCollapsed: boolean[] = [], I faced another error saying "Maximum call stack size exceeded."
Here is a link to the StackBlitz project showcasing the issue - any assistance or solution would be highly appreciated.