multiple Accordion's build with ngFor ['Element': '#3.1' is not a valid selector.]
See original GitHub issueBug description:
- in template(html) I want multiple accordions buld with for lop, how to define them in typescript
- in typescript I want for specific accordion to toggel specific panel
is this even possible?
- HTML:
<div class="panel-group"
*ngFor="let fqa of faqs, let i = index">
<h5 [id]="fqa.id">{{fqa.section}}</h5>
<ngb-accordion #acc="ngbAccordion"
[id]="fqa.id">
<ngb-panel *ngFor="let q of fqa.qa"
[id]="q.id"
title="V: {{q.question}}">
<ng-template ngbPanelContent>
<span class="badge badge-primary">O:</span>
<span style="text-align: justify"
[innerHtml]="q.answer"></span>
</ng-template>
</ngb-panel>
</ngb-accordion>
</div>
- typescript:
@ViewChildren('acc')
accordions: QueryList<NgbAccordion>;
- error:
Failed to execute 'querySelector' on 'Element': '#1.1' is not a valid selector.
at NgbAccordion._getPanelElement (http://localhost:4200/vendor.js:1874:44)
Versions of Angular, ng-bootstrap and Bootstrap:
Angular: 13
ng-bootstrap: 10.0.0
Bootstrap: 4.6.0
Issue Analytics
- State:
- Created 2 years ago
- Comments:9
Top Results From Across the Web
How to use ngb-accordion in a ngFor loop? - Stack Overflow
I want make it possible that when one of the accordion elements includes the property 'OpenAccordion' the panel of that element opens. So...
Read more >angular/angular - Gitter
I have a component with a custom ValueAccessor and if I put any validation on top of it it doesnt work.
Read more >Release notes v2.0.0 - Alfresco Builder Network
These release notes provide information for the 2.0.0 release of the Alfresco Application Development Framework. This is the first General Available release ...
Read more >Angular 2+ Notes for Professionals - Ketabton
not a liated with o cial Angular 2+ group(s) or company(s). ... For each element in the array, *ngFor creates a...
Read more >JDI Light Framework - GitHub Pages
JDI Light is a powerful Test Automation Framework that helps to make your tests ... is valid for the logout button on Contact...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi First you shouldn’t use the id at two points here <h5 [id]=“fqa.id”> and <ngb-accordion #acc=“ngbAccordion” [id]=“fqa.id”>
If will fix the issue the issue in ng-bootstrap. Meanwhile using a char as first character in the id is a workaround. This is the issue you have with the Panel --> start with a char will work. Thing is explained here: https://mathiasbynens.be/notes/css-escapes Best regards Florent