-2

I have an input like

<mat-form-field>
      <input id="filter_administrationTable_{{ componentName }}" matInput
             (keyup)="administrationTableFilter($event.target.value)" placeholder="{{ filterLabel }}">
    </mat-form-field>

This is used as a filter to a table. After updating my data table, I would like to clear value of filter and clear it in frontend as well. How do I do it in Angular?

Maciej Miśkiewicz
  • 412
  • 2
  • 8
  • 22

2 Answers2

0

Check out Clearing an input text field in Angular2 where they use [value] property binding and "Clear" button as a solution to this.

0

It was enough to use [(ngModel)]="filterValue" and clear it.

Maciej Miśkiewicz
  • 412
  • 2
  • 8
  • 22