how to split a bootstrap accordian between parent and child components in Angular 18

I have a static site in which a trio of side-by-side text boxes each have a button which opens a collapsible section with 100% screen width below the three text boxes. Now I’m trying to recreate that in Angular 18 using ng-bootstrap and it seems to be much harder. I think I need to configure the logic globally and I’m hoping someone might be able to point me in the direction of how to do that please.

I have this in the html template of an Angular parent component:

<div ngbAccordion class="d-flex w-100"  #accordion="ngbAccordion">
   <app-accordion-test 
      *ngFor="let accordionItem of accordionList; track accordionItem"         
      [accordionItem]="accordionItem"
      [ngbAccordionItem]="accordionItem.id"         
        >
   </app-accordion-test>
 </div>

accordionList is an array of objects injected from a service:

[
{id: "first"},
{id: "second"},
{id: "third"}
]

And this in the corresponding child component app-accordion-test:

<div>
  <h2 ngbAccordionHeader>
     <button ngbAccordionButton>{{accordionItem.id}}</button>
  </h2>
  <div ngbAccordionCollapse>
    <div ngbAccordionBody>
       <ng-template>
          <h2>Template test</h2>
           <p>Content for the {{accordionItem.id}} </p>
        </ng-template>
    </div>
  </div>
</div>

The above code is an experiment to see if the Accordion logic can be split between a parent and a child element, since that’s the only way I can see that I can have three text boxes in children which can then have a 100vw collapsible section appear below them. It demonstrates some of the features of the accordion but it’s glitchy. The buttons don’t work as expected in a few ways, the most problematic of which is that having shown the collapsible content, reclicking the button does not make it disappear. Trying to collapse the content produces this error in the console:

TypeError: Cannot read properties of undefined (reading ‘ngbCollapse’)

Interpreting the elements in the developer console, I’ve noticed that my attempt produces two identifiers:

ng_content_[alphanumerical string]
ng_host_[different alphanumerical string]

Whereas the model accordion code (not split between parent and child) from the ng_bootstrap site has only one:

ng_content_[alphanumerical string]

Looking at the ng-bootstrap docs: global configuration of accordions, I wonder if maybe I need to configure globally, but I don’t really have any idea what that might involve.

@Component({
    selector: 'ngbd-accordion-config',
    standalone: true,
    imports: [NgbAccordionModule],
    templateUrl: './accordion-config.html',
    providers: [NgbAccordionConfig], // add the NgbAccordionConfig to the component providers
})
export class NgbdAccordionConfig {
    constructor(config: NgbAccordionConfig) {
        // customize default values of accordions used by this component tree
        config.closeOthers = true;
    }
}

Would really appreciate any pointers / advice / solutions. Thanks in advance!

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật