小编bar*_*ing的帖子

角材料表循环遍历项目数组

我尝试在 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)

angular-material angular mat-table

0
推荐指数
1
解决办法
9068
查看次数

标签 统计

angular ×1

angular-material ×1

mat-table ×1