A similar question was answered, but I cannot find out why the code is not working for me. I have a list of ngbpanels generated using ngFor. I need to expand/de-expand a specific panel according to some logic
In the html file
<ngb-accordion #acc="ngbAccordion" >
<ngb-panel *ngFor="let panel of panels; let panelIndex=index" id="{{panelIndex}}">
....
In the ts file:
@ViewChild('acc') panelsView;
....
this.panelsView.toggle(this.panelIndex);
The panel is open and by writing that code I wish it would toggle under specific condition. The code does not give me any errors but the panel stays open