I developed an angular app with a collapse feature, but I noticed that multiple collapses can be open at once. I am utilizing Ng-Bootstrap collapse for this functionality. Below is the code snippet from the TS file:
public isCollapsed = true;
And here is the corresponding HTML code:
<tr
class="row-green pe-auto"
(click)="collapse.toggle()"
[attr.aria-expanded]="!isCollapsed"
>
...
...
...
</tr>
<tr class="clp-row clp-r1">
...
...
...
</tr>
<tr
class="row-blue"
(click)="collapse.toggle()"
[attr.aria-expanded]="!isCollapsed"
>
...
...
...
</tr>
<tr class="clp-row clp-r1">
...
...
...
</tr>
I want to ensure that each collapsible section functions independently so that opening one does not impact the others.