【发布时间】:2018-07-23 19:53:18
【问题描述】:
我有一个父组件和大约 60 个子组件。根据父母的数据,我应该在 *ngFor 循环中加载适当的组件。这是我的代码:
<ng-container *ngFor="let widget of ribonData.widgets">
<div *ngIf="some conditions"></div>
** here i should generate child components tag based on "widget.action" property. **
for example if "widget.action" is "color" i should generate <color-component></color-component>
</ng-container>
有什么建议吗?
【问题讨论】:
标签: angular angular5 angular-components