So I have a component with a <template>
<some-component [data]="someArray">
<template>foo<template>
</some-component>
and it's using this to get hold of the template
@ContentChild(TemplateRef)
public tmpl: TemplateRef<any>;
which is then used in its template like this
<div *ngFor="let item of someArrayFromDataInput">
<template [ngTemplateOutlet]="tmpl"></template>
</div>
now I would like to be able to print some data from item
in the original template, basically to be able to do this
<some-component [data]="someArray">
<template>foo {{ item }}<template>
</some-component>
is it possible somehow?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…