Angular 如何根据角度中返回对象的数量动态生成扩展面板?

Angular 如何根据角度中返回对象的数量动态生成扩展面板?,angular,Angular,请帮助我在基于WebAPI返回的对象的角度材质扩展面板上动态显示数据 <mat-expansion-panel> <mat-expansion-panel-header> <mat-panel-title> This is the expansion title </mat-panel-title> <mat-panel-description> This is a summa

请帮助我在基于WebAPI返回的对象的角度材质扩展面板上动态显示数据

    <mat-expansion-panel>
  <mat-expansion-panel-header>
    <mat-panel-title>
      This is the expansion title
    </mat-panel-title>
    <mat-panel-description>
      This is a summary of the content
    </mat-panel-description>
  </mat-expansion-panel-header>
  <ng-template matExpansionPanelContent>
    <p>This is the primary content of the panel</p>
  </ng-template>
</mat-expansion-panel>
只需在要迭代的块中添加*ngFor指令:

<mat-accordion>
 <mat-expansion-panel *ngFor="let item of items;">
    <mat-expansion-panel-header>
      <mat-panel-title>
        This is the expansion title
      </mat-panel-title>
      <mat-panel-description>
        This is a summary of the content
      </mat-panel-description>
    </mat-expansion-panel-header>
    <ng-template matExpansionPanelContent>
      <p>This is the primary content of the panel</p>
    </ng-template>
  </mat-expansion-panel>
</mat-accordion>

我想使用*NGFOR在扩展面板上进行迭代,请参见:@mmodalities发生了什么?你能给我一个线索吗?