P
P
part_os2020-05-15 23:44:29
Angular
part_os, 2020-05-15 23:44:29

How to collapse to open each one?

There are many elements:

<button type="button" class="btn btn-primary" (click)="isCollapsed = !isCollapsed"
        [attr.aria-expanded]="!isCollapsed" aria-controls="collapseBasic1">Toggle collapse
</button>
<hr>
<div id="collapseBasic1" [collapse]="isCollapsed">
  <div class="well well-lg card card-block card-header">Some content</div>
</div>

<button type="button" class="btn btn-primary" (click)="isCollapsed = !isCollapsed"
        [attr.aria-expanded]="!isCollapsed" aria-controls="collapseBasic1">Toggle collapse
</button>
<hr>
<div id="collapseBasic1" [collapse]="isCollapsed">
  <div class="well well-lg card card-block card-header">Some content</div>
</div>


the component says:
isCollapsed = false;

now they all open on click, how to make them open each on their own button?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Shvets, 2020-05-16
@part_os

I found your example and tweaked it a bit.
No need to produce extra variables.
https://stackblitz.com/edit/ngx-bootstrap-collapse...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question