1

So I need to have a filter for each column in angular material table but table headers are dynamic. I couldn't find soultion for dynamic headers, I only find out how to filter through static headers.

I want something like this but with dynamic headers:

enter image description here

Anyone have any solutions?

Kruno
  • 121
  • 1
  • 1
  • 13
  • I resolved this. Found solution here: https://stackoverflow.com/questions/48276404/filtering-specific-column-in-angular-material-table-in-angular-5/54577092#54577092 – Kruno Dec 02 '20 at 14:19

1 Answers1

0
  1. Create a form with column keys you want to filter
  2. Subscribe form and create a predicate
  3. On HTML side, based on column key (dynamic key) get form control

Here is stackblitz example.

Gourav Garg
  • 2,856
  • 11
  • 24