【发布时间】:2020-01-17 10:50:00
【问题描述】:
我必须使用 Angular 8 中的primeng 将选项卡内容(带有内容的primeng 卡片)动态添加到tabview 中。我正在尝试使用ComponentFactoryResolver 动态生成组件。请建议最好的方法。 我附上了图片以供参考。
<p-tabView class="ui-g-12 ui-g-nopad ui-widget-content ui-corner-all ui-no-border" [activeIndex]="index" (onChange)="onProductSelect($event)" >
<p-tabPanel #tabContent *ngFor="let product of productNames; let i = index;let first = first;" [selected]="first" [disabled]="isAllowedAccess"[enter link description here][1]
[header]="'Profile ' + product.productName" lazy="true">
// <div>Content</div> tab content which is list of cards with content.here i have to add components dynamically
</p-tabPanel>
</p-tabView>
【问题讨论】: