Directive to mark a template as the accordion body — the panel's collapsible
content. Use this INSTEAD of placing content directly in the panel when the body
may be expensive (code editors, grids, large lists) OR just to be future-proof:
the accordion instantiates the template lazily on first expand and then keeps
it alive, so nothing is created until the user opens the panel, while later
open/close still animates. Consumers never have to reason about content weight or
write @if (expanded) themselves.
Example
<mj-accordion-panel[Expanded]="open"(ExpandedChange)="open = $event"> <ng-templatemjAccordionTitle>Configuration</ng-template> <ng-templatemjAccordionBody> <mj-code-editor...></mj-code-editor><!-- not created until first opened --> </ng-template> </mj-accordion-panel>
Directive to mark a template as the accordion body — the panel's collapsible content. Use this INSTEAD of placing content directly in the panel when the body may be expensive (code editors, grids, large lists) OR just to be future-proof: the accordion instantiates the template lazily on first expand and then keeps it alive, so nothing is created until the user opens the panel, while later open/close still animates. Consumers never have to reason about content weight or write
@if (expanded)themselves.Example