From 1eddf221467396a28ddc738ad6d4bf753182ec68 Mon Sep 17 00:00:00 2001 From: Jeremias Peier Date: Thu, 13 Jan 2022 14:51:33 +0100 Subject: [PATCH] fix(cdk/table): revert breaking change of CdkTable constructor With Release 13.1.2 a breaking change was introduced in cdk/table. If a consumer has a class which extends CdkTable, compilation breaks due to the newly introduced required constructor parameter _ngZone. See PR: https://github.com/angular/components/pull/23885 --- src/cdk/table/table.ts | 2 +- tools/public_api_guard/cdk/table.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cdk/table/table.ts b/src/cdk/table/table.ts index 3ed73c43b66d..38555c8ccda8 100644 --- a/src/cdk/table/table.ts +++ b/src/cdk/table/table.ts @@ -531,7 +531,7 @@ export class CdkTable implements AfterContentChecked, CollectionViewer, OnDes * @breaking-change 14.0.0 */ @Optional() - protected readonly _ngZone: NgZone, + protected readonly _ngZone?: NgZone, ) { if (!role) { this._elementRef.nativeElement.setAttribute('role', 'table'); diff --git a/tools/public_api_guard/cdk/table.md b/tools/public_api_guard/cdk/table.md index c35f12421a58..e3fcc520ed33 100644 --- a/tools/public_api_guard/cdk/table.md +++ b/tools/public_api_guard/cdk/table.md @@ -290,7 +290,7 @@ export class CdkRowDef extends BaseRowDef { export class CdkTable implements AfterContentChecked, CollectionViewer, OnDestroy, OnInit { constructor(_differs: IterableDiffers, _changeDetectorRef: ChangeDetectorRef, _elementRef: ElementRef, role: string, _dir: Directionality, _document: any, _platform: Platform, _viewRepeater: _ViewRepeater, RowContext>, _coalescedStyleScheduler: _CoalescedStyleScheduler, _viewportRuler: ViewportRuler, _stickyPositioningListener: StickyPositioningListener, - _ngZone: NgZone); + _ngZone?: NgZone | undefined); addColumnDef(columnDef: CdkColumnDef): void; addFooterRowDef(footerRowDef: CdkFooterRowDef): void; addHeaderRowDef(headerRowDef: CdkHeaderRowDef): void; @@ -334,7 +334,7 @@ export class CdkTable implements AfterContentChecked, CollectionViewer, OnDes // (undocumented) ngOnInit(): void; // @deprecated (undocumented) - protected readonly _ngZone: NgZone; + protected readonly _ngZone?: NgZone | undefined; _noDataRow: CdkNoDataRow; // (undocumented) _noDataRowOutlet: NoDataRowOutlet;