Angular 使用<;访问父级中的子级数据;天然气含量>;

Angular 使用<;访问父级中的子级数据;天然气含量>;,angular,Angular,我试图在父级的子级中包含一些模板,但我需要访问tranclusions中的子属性。 有什么办法吗 子组件:- <ul> <li *ngFor="let item of companies"> {{item.name}} <ng-content></ng-content> </li> </ul> <app-child [companies]="companies"> <a href=""

我试图在父级的子级中包含一些模板,但我需要访问tranclusions中的子属性。 有什么办法吗

子组件:-

<ul>
  <li *ngFor="let item of companies">
    {{item.name}} <ng-content></ng-content>
  </li>
</ul>
<app-child [companies]="companies">
  <a href="">
    Visit {{item}}
  </a>
</app-child>
    {{item.name}
父组件:-

<ul>
  <li *ngFor="let item of companies">
    {{item.name}} <ng-content></ng-content>
  </li>
</ul>
<app-child [companies]="companies">
  <a href="">
    Visit {{item}}
  </a>
</app-child>

我需要在父组件中添加“项”


Stackblitz

使用ng模板是可能的。谢谢@enno.void!你能改变上面提到的stackblitz并使用它工作吗?