API reference for Angular CDK accordion
import {CdkAccordionModule} from '@angular/cdk/accordion';
Directives
CdkAccordionItem
A basic directive expected to be extended and decorated as a component. Sets up all events and attributes needed to be managed by a CdkAccordion parent.
Selector: cdk-accordion-item [cdkAccordionItem]
Exported as: cdkAccordionItemProperties
| Name | Description |
|---|---|
@Input({ transform: booleanAttribute })
|
Whether the AccordionItem is disabled. |
@Input({ transform: booleanAttribute })
|
Whether the AccordionItem is expanded. |
@Output()
|
Event emitted every time the AccordionItem is closed. |
@Output()
|
Event emitted when the AccordionItem is destroyed. |
@Output()
|
Event emitted every time the AccordionItem is opened. |
|
|
|
The unique AccordionItem id. |
Methods
close
(): void
|
|
|---|---|
|
Sets the expanded state of the accordion item to false. |
open
(): void
|
|
|---|---|
|
Sets the expanded state of the accordion item to true. |
toggle
(): void
|
|
|---|---|
|
Toggles the expanded state of the accordion item. |
CdkAccordion
Directive whose purpose is to manage the expanded state of CdkAccordionItem children.
Selector: cdk-accordion [cdkAccordion]
Exported as: cdkAccordionProperties
| Name | Description |
|---|---|
@Input({ transform: booleanAttribute })
|
Whether the accordion should allow multiple expanded accordion items simultaneously. |
|
A readonly id value to use for unique selection coordination. |
Methods
closeAll
(): void
|
|
|---|---|
|
Closes all enabled accordion items. |
openAll
(): void
|
|
|---|---|
|
Opens all enabled accordion items in an accordion where multi is enabled. |
Constants
CDK_ACCORDION
Injection token that can be used to reference instances of CdkAccordion. It serves
as alternative token to the actual CdkAccordion class which could cause unnecessary
retention of the class and its directive metadata.
const CDK_ACCORDION: InjectionToken;