File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ import {
3232 ANIMATION_MODULE_TYPE ,
3333 inject ,
3434} from '@angular/core' ;
35+ import { _IdGenerator } from '@angular/cdk/a11y' ;
3536import { Subject } from 'rxjs' ;
3637import { filter , startWith , take } from 'rxjs/operators' ;
3738import { MatAccordionBase , MatAccordionTogglePosition , MAT_ACCORDION } from './accordion-base' ;
@@ -42,9 +43,6 @@ import {MatExpansionPanelContent} from './expansion-panel-content';
4243/** MatExpansionPanel's states. */
4344export type MatExpansionPanelState = 'expanded' | 'collapsed' ;
4445
45- /** Counter for generating unique element ids. */
46- let uniqueId = 0 ;
47-
4846/**
4947 * Object that can be used to override the default options
5048 * for all of the expansion panels in a module.
@@ -145,7 +143,7 @@ export class MatExpansionPanel
145143 _portal : TemplatePortal ;
146144
147145 /** ID for the associated header element. Used for a11y labelling. */
148- _headerId = ` mat-expansion-panel-header-${ uniqueId ++ } ` ;
146+ _headerId : string = inject ( _IdGenerator ) . getId ( ' mat-expansion-panel-header-' ) ;
149147
150148 constructor ( ...args : unknown [ ] ) ;
151149
You can’t perform that action at this time.
0 commit comments