Skip to content

Commit

Permalink
fix(cdk/scrolling): adds ngTemplateContextGuard
Browse files Browse the repository at this point in the history
implements ngTemplateContextGuard for CdkVirtualForOf directive

fixes angular#26609
  • Loading branch information
naaajii committed Jun 11, 2023
1 parent 018ee64 commit 3635e9e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/cdk/scrolling/virtual-for-of.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,4 +395,11 @@ export class CdkVirtualForOf<T>
index,
};
}

public static ngTemplateContextGuard<T>(
directive: CdkVirtualForOf<T>,
context: unknown,
): context is CdkVirtualForOfContext<T> {
return true;
}
}
2 changes: 2 additions & 0 deletions tools/public_api_guard/cdk/scrolling.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ export class CdkVirtualForOf<T> implements CdkVirtualScrollRepeater<T>, Collecti
ngDoCheck(): void;
// (undocumented)
ngOnDestroy(): void;
// (undocumented)
static ngTemplateContextGuard<T>(directive: CdkVirtualForOf<T>, context: unknown): context is CdkVirtualForOfContext<T>;
readonly viewChange: Subject<ListRange>;
// (undocumented)
static ɵdir: i0.ɵɵDirectiveDeclaration<CdkVirtualForOf<any>, "[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>;
Expand Down

0 comments on commit 3635e9e

Please sign in to comment.