我尝试在 Mat-table 中打印我的数据。
我非常接近,但我无法完成我的前端。
我的数据是:
0: {Group: 1, Rules: Array(1), Title: "NAME"}
1: {Group: 2, Rules: Array(2), Title: "TERRITORY"}
And the array for Group 1 have rules like this (and so on for Group 2):
0: {Date: "1990-01-01", NewRules: 0, Rules: "Ligue Name", Id: 1}
1: {Date: "1990-01-01", NewRules: 1, Rules: "Other rules", Id: 2}
Run Code Online (Sandbox Code Playgroud)
这是 .html 代码:
<mat-card-content>
<table mat-table [dataSource]="rules$ | async" class="mat-elevation-z8">
<!-- DateModifier Column -->
<ng-container matColumnDef="Date">
<th mat-header-cell *matHeaderCellDef>Date</th>
<td mat-cell *matCellDef="let element">
{{ element.Reules[0].Date …Run Code Online (Sandbox Code Playgroud)