我正在尝试使用角度材料扩展面板显示一组项目,但它没有显示任何内容。我知道扩展面板使用 ng-content 将内容投影到面板组件中。这是我的模板代码的样子:
<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>
<div *ngFor="let record of records">
<span class="detail-label">Record ID</span>
<span class="detail-value">{{ record?.id }}</span>
<span class="detail-label">Employee Number</span>
<span class="detail-value">{{ record?.employeeNumber }}</span>
</div>
</mat-expansion-panel>