Problems using accordion inside accordion with Angular 4

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:


<ngb-accordion>
    <ngb-panel title="First panel">
        <template ngbPanelContent>
            <ngb-accordion>
                <ngb-panel id="1" title="First panel">
                    <template ngbPanelContent>
                        Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird
                        on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table,
                        raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
                    </template>
                </ngb-panel>
            </ngb-accordion>
        </template>
    </ngb-panel>
</ngb-accordion>

2 thoughts on “Problems using accordion inside accordion with Angular 4

  1. 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)