From f140369e8c14f07e9348f011891fbca56e675511 Mon Sep 17 00:00:00 2001 From: Philipp Burgmer Date: Wed, 7 Dec 2022 11:59:14 +0100 Subject: [PATCH] fix(module:list): specify template ref context to match instantiation * input was specified as TemplateRef but usage of template provides a context * providing a context was/is possible because Angular does not check the template reference and the provided context to match * consuming the context and pass in a template ref with context is also possible because a template ref is TemplateRef per default --- components/list/list.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/list/list.component.ts b/components/list/list.component.ts index 61354e9bd5..e6667cbd7d 100644 --- a/components/list/list.component.ts +++ b/components/list/list.component.ts @@ -116,7 +116,7 @@ export class NzListComponent implements AfterContentInit, OnChanges, OnDestroy, @Input() nzHeader?: string | TemplateRef; @Input() nzFooter?: string | TemplateRef; @Input() nzItemLayout: NzDirectionVHType = 'horizontal'; - @Input() nzRenderItem: TemplateRef | null = null; + @Input() nzRenderItem: TemplateRef<{ $implicit: NzSafeAny; index: number }> | null = null; @Input() @InputBoolean() nzLoading = false; @Input() nzLoadMore: TemplateRef | null = null; @Input() nzPagination?: TemplateRef;