I have a table and I want to put a search box on top of the table which dynamically search in table data and filter it for enabling user to find table for easier.
my table code is:
<mat-card class="fields-list" *ngIf="tableShown">
<mat-card-content>
<mat-card-actions align="end">
<button type="button" class="topia-btn topia-primary-btn action-buttons" (click)="addClicked()">
Add New Office
</button>
</mat-card-actions>
<mat-table #table [dataSource]="officePinList">
<ng-container cdkColumnDef="label">
<mat-header-cell *cdkHeaderCellDef fxFlex="20%">Label</mat-header-cell>
<mat-cell *cdkCellDef="let officePin" fxFlex="20%">{{officePin.label}}</mat-cell>
</ng-container>
<ng-container cdkColumnDef="postalAddress">
<mat-header-cell *cdkHeaderCellDef fxFlex="55%">Postal Adress</mat-header-cell>
<mat-cell *cdkCellDef="let officePin" fxFlex="55%">{{officePin.postalAddress}}</mat-cell>
</ng-container>
<ng-container cdkColumnDef="trash-icon">
<mat-header-cell *cdkHeaderCellDef fxFlex="15%"></mat-header-cell>
<mat-cell *cdkCellDef="let officePin" fxFlex="15%">
<mat-icon (click)="deleteGroupOffices(officePin.id)" mat-list-icon matTooltip="Delete" class="icon">
delete_forever
</mat-icon>
<mat-icon (click)="editField(officePin.id)" mat-list-icon matTooltip="Edit" class="icon">edit</mat-icon>
</mat-cell>
</ng-container>
<mat-header-row *cdkHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row class="table-row" *cdkRowDef="let officePin; columns: displayedColumns;"></mat-row>
</mat-table>
My table data source is officePinList
How can I filter table data with dynamic search box for the table exactly like this: https://ciphertrick.com/demo/angularajaxsearch/