I have two arrays:
- one with
categories - one with
datarecords
Every data record belongs to a specific category.
With every use of a filter (e.g. searchfield) on the datarecords, I want to add the total count of records per category to each category-object, so I can display them on every tab-pane (e.g. text: Algemeen, value: 'general, countFiltered: 2)
I made a fiddle for this.
Till now I get no count-filtered, locally I get a constant error corresponding to line 78 in my fiddle:
Uncaught (in promise) Type Error: Cannot read property '0' of undefined
How can I achieve this?