how to prevent pannel toggle event in ngb accordian code example
Example 1: how to prevent pannel toggle event in ngb accordian
HTML:
<ngb-accordion (panelChange)="toggleAccordian($event)">
TS:
public toggleAccordian( props:NgbPanelChangeEvent ): void{
props.nextState // true === panel is toggling to an open state
// false === panel is toggling to a closed state
props.panelId // the ID of the panel that was clicked
props.preventDefault(); // don't toggle the state of the selected panel
}
Example 2: how to prevent pannel toggle event in ngb accordian
public toggleAccordian( props:NgbPanelChangeEvent ): void{
props.nextState // true === panel is toggling to an open state
// false === panel is toggling to a closed state
props.panelId // the ID of the panel that was clicked
props.preventDefault(); // don't toggle the state of the selected panel
}