-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems using accordion inside accordion with Angular 4 #1433
Comments
Try to use ng-template instead of template. |
Please provide a minimal reproduce scenario using plunker as requested in the issue template, otherwise this one is not actionable and will be closed: https://github.com/ng-bootstrap/ng-bootstrap#you-think-youve-found-a-bug |
@mohammedzamakhan sadly it does not fix it - it breaks everything. It seems that ngbPanelTitle / ngbPanelContent is not working with "ng-template". This Plunkr shows an accordion not working with In this plunkr are two accordion panels, one with Notice the config:
|
I've "purged" ;) my comments a little. At the first moment i thougt i ran into the same issue, but now it seems different. @JoseDRojasA i created a plunkr for you which shows nested accordions in angular2.4.1. I cant get them to work, the nested panel title disappears after clicking: |
I guess we should update selectors to allow I'm going to tentatively mark it as an approximate duplicate of #1337 |
As a work-around please keep using |
Plan for the complete switch to Angular 4 here: #1439 |
I updated my project to Angular 4.1.0 and ng-bootstrap 1.0.0-alpha.25. I changed all templates to ng-template but when i tried to use an accordion with another accordion inside again, the issue persisted. Here is the plunker: https://plnkr.co/edit/JvsDtOIms69iWSHt3l3B?p=preview |
Pretty much the same thing happens with nested tabs: http://plnkr.co/edit/Gu36tzIlg35DNikjR8kt?p=preview |
Here is work around for nested tab by using extra template http://stackoverflow.com/a/43720470/2435473 |
OK, so yesterday I've spent some time with Tobias from the Angular team debugging this issue. It turns out that the root cause is a bug in Angular's handling of queries. I've opened an issue to track resolution of Angular's bug here: angular/angular#16568 Ultimately the solution for this problem will come from angular/angular#16568 but till it is fixed on the Angular side you can use a work-around from http://stackoverflow.com/a/43720470/2435473 (thnx @pankajparkar) |
Another solution I found is to wrap the inner accordion in another component, which would essentially do behind the scenes what the previous workaround does. |
This should be fixed on the Angular side via angular/angular#18326 |
This just got fixed in Angular via angular/angular#18326 so closing it here. |
Angular |
I need to use an accordion with other accordions inside. When i was using Angular 2, i worked perfect but when i update to angular 4 using angular-cli 1.0, It stops working.
Here is the code:
The text was updated successfully, but these errors were encountered: