Search code examples
angularbootstrap-4ng-bootstrap

how to change activeIds of ngb Accordion based on the button we click in angular


I'm implementing the ngbAccordion in a modal in another component. When I click on a button1 ,my modal with the accordian should popup, with "Acc1" tab open , similarly with button 2.

Could anyone help me. please find my code.

https://stackblitz.com/edit/github-6r9hfp-k7upwx?file=src%2Fapp%2FaccordionInModal%2Facc-in-modal.component.html


Solution

  • Answer updated: Just used @Input directive for panelId . Please find it here: https://stackblitz.com/edit/github-6r9hfp-k7upwx?file=src%2Fapp%2Fapp.component.ts