【问题标题】:Dynamically Add tabPanel content which is list of cards to tabView in PrimeNg在 PrimeNg 中动态添加作为卡片列表的 tabPanel 内容到 tabView
【发布时间】: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>

【问题讨论】:

    标签: primeng angular8 tabview


    【解决方案1】:

    您可以在 p-tabContent 中使用 *ngFor 来渲染所有卡片。这将是标准的Angular,与primeNG无关

    <div *ngFor="let mortgage of mortgages">
    ... render the content
    </div>
    

    我错过了什么?

    【讨论】:

      猜你喜欢
      • 2019-07-30
      • 2017-01-16
      • 2021-12-02
      • 1970-01-01
      • 2013-01-07
      • 1970-01-01
      • 2021-05-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多