Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在angular数据表中查找行,并使用angular中的条件隐藏某些行?_Angular - Fatal编程技术网

如何在angular数据表中查找行,并使用angular中的条件隐藏某些行?

如何在angular数据表中查找行,并使用angular中的条件隐藏某些行?,angular,Angular,如何获取行并将其隐藏在角度数据表中 我试过使用下面的代码 <div class="mat-elevation-z8 bg-white rounded" > <table mat-table class="full-width-table table table-hover table-stripe " [dataSource]="dataSource" matSort aria-label="Elements"> <ng-container matCol

如何获取行并将其隐藏在角度数据表中

我试过使用下面的代码

<div class="mat-elevation-z8 bg-white rounded" >
  <table mat-table class="full-width-table table table-hover table-stripe " [dataSource]="dataSource" matSort aria-label="Elements">
    <ng-container matColumnDef="id">
      <th mat-header-cell *matHeaderCellDef mat-sort-header>Username</th>
      <td mat-cell *matCellDef="let row">{{row.id}}</td>
    </ng-container>
    <ng-container matColumnDef="name" class="bg-info">
      <th mat-header-cell *matHeaderCellDef mat-sort-header >Coin</th>
      <td mat-cell *matCellDef="let row"  [hidden]="row.name=='hydro'">{{row.name}}</td>
    </ng-container>
      <ng-container matColumnDef="sell">
          <th mat-header-cell *matHeaderCellDef mat-sort-header>Selling</th>
          <td mat-cell *matCellDef="let row" class="bg-success">${{row.sell}}
            <span class="badge badge-info rounded">buy</span>
          </td>
        </ng-container>
    <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
    <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
  </table>
</div>

用户名
{{row.id}}
硬币
{{row.name}
销售
${{row.sell}
购买

我希望能够使用某些条件隐藏某些行

您可以利用筛选功能。“带筛选的表”示例您可以利用筛选功能。“带筛选的表”示例