Advertisement
DarthCoffee

Untitled

Jul 18th, 2020
1,880
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.68 KB | None | 0 0
  1. <!-- app.comment.html -->
  2. <div>
  3.   <mat-form-field *ngFor="let filter of filterSelectObj" style="margin-left: 15px;">
  4.     <mat-label>Filter {{filter.name}}</mat-label>
  5.     <select matNativeControl name="{{filter.columnProp}}" [(ngModel)]="filter.modelValue"
  6.      (change)="filterChange(filter,$event)">
  7.       <option value="">-- Select {{filter.name}} --</option>
  8.       <option [value]="item" *ngFor="let item of filter.options">{{item}}</option>
  9.     </select>
  10.   </mat-form-field>
  11.   &nbsp;
  12.   <button mat-flat-button color="warn" (click)="resetFilters()">Reset</button>
  13. </div>
  14.  
  15. <table mat-table [dataSource]="dataSource">
  16.  
  17.   <ng-container matColumnDef="category">
  18.     <th mat-header-cell *matHeaderCellDef> category </th>
  19.     <td mat-cell *matCellDef="let element"> {{element.category}} </td>
  20.   </ng-container>
  21.  
  22.   <ng-container matColumnDef="name">
  23.     <th mat-header-cell *matHeaderCellDef>name </th>
  24.     <td mat-cell *matCellDef="let element"> {{element.name}} </td>
  25.   </ng-container>
  26.  
  27.   <ng-container matColumnDef="price">
  28.     <th mat-header-cell *matHeaderCellDef> price</th>
  29.     <td mat-cell *matCellDef="let element"> {{element.price}} </td>
  30.   </ng-container>
  31.  
  32.   <ng-container matColumnDef="rating">
  33.     <th mat-header-cell *matHeaderCellDef> rating </th>
  34.     <td mat-cell *matCellDef="let element"> {{element.rating}} </td>
  35.   </ng-container>
  36.  
  37.   <ng-container matColumnDef="brand">
  38.     <th mat-header-cell *matHeaderCellDef> brand </th>
  39.     <td mat-cell *matCellDef="let element"> {{element.brand}} </td>
  40.   </ng-container>
  41.  
  42.  
  43.  
  44.   <tr mat-header-row *matHeaderRowDef="displayedColumns;"></tr>
  45.   <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
  46.  
  47. </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement