From 3635e9eb9d730f63d7884a1940a27fd958e8ec18 Mon Sep 17 00:00:00 2001 From: Naaajii <54370141+Naaajii@users.noreply.github.com> Date: Sun, 11 Jun 2023 16:37:50 +0500 Subject: [PATCH] fix(cdk/scrolling): adds ngTemplateContextGuard implements ngTemplateContextGuard for CdkVirtualForOf directive fixes #26609 --- src/cdk/scrolling/virtual-for-of.ts | 7 +++++++ tools/public_api_guard/cdk/scrolling.md | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/cdk/scrolling/virtual-for-of.ts b/src/cdk/scrolling/virtual-for-of.ts index f6bc01b86447..c5d1f1a07fa3 100644 --- a/src/cdk/scrolling/virtual-for-of.ts +++ b/src/cdk/scrolling/virtual-for-of.ts @@ -395,4 +395,11 @@ export class CdkVirtualForOf index, }; } + + public static ngTemplateContextGuard( + directive: CdkVirtualForOf, + context: unknown, + ): context is CdkVirtualForOfContext { + return true; + } } diff --git a/tools/public_api_guard/cdk/scrolling.md b/tools/public_api_guard/cdk/scrolling.md index f7e4792d97e4..9298a326f1f4 100644 --- a/tools/public_api_guard/cdk/scrolling.md +++ b/tools/public_api_guard/cdk/scrolling.md @@ -121,6 +121,8 @@ export class CdkVirtualForOf implements CdkVirtualScrollRepeater, Collecti ngDoCheck(): void; // (undocumented) ngOnDestroy(): void; + // (undocumented) + static ngTemplateContextGuard(directive: CdkVirtualForOf, context: unknown): context is CdkVirtualForOfContext; readonly viewChange: Subject; // (undocumented) static ɵdir: i0.ɵɵDirectiveDeclaration, "[cdkVirtualFor][cdkVirtualForOf]", never, { "cdkVirtualForOf": { "alias": "cdkVirtualForOf"; "required": false; }; "cdkVirtualForTrackBy": { "alias": "cdkVirtualForTrackBy"; "required": false; }; "cdkVirtualForTemplate": { "alias": "cdkVirtualForTemplate"; "required": false; }; "cdkVirtualForTemplateCacheSize": { "alias": "cdkVirtualForTemplateCacheSize"; "required": false; }; }, {}, never, never, true, never, false>;