小编Bre*_*eno的帖子

for循环中的ng内容

我正在尝试使用引导程序创建一个选项卡组件。

<app-tabs>
  <app-tab [label]="'label1'">Description 1</app-tab>
  <app-tab [label]="'label2'">Description 2</app-tab>
</app-tabs>
Run Code Online (Sandbox Code Playgroud)

我看过这篇文章:https : //juristr.com/blog/2016/02/learning-ng2-creating-tab-component/ 但我的用例不同。

我需要<ng-content>在 for 的每个循环中使用不同的。这是我的 plunker:https ://plnkr.co/edit/N2p8Vx ? p = preview 它在第二个选项卡中打印两个描述,将第一个留空。

感谢任何帮助!

angular2-ngcontent angular

3
推荐指数
1
解决办法
6813
查看次数

标签 统计

angular ×1

angular2-ngcontent ×1