Group by in Angular Material table

preview_player
Показать описание
Let's transform incoming API data in order to be displayed nicely with Angular material table. We will be able then to sort and group by the table items with the help of JavaScript reduce() method.

My courses:
Angular & Laravel

Angular & Stripe

💖Support on Patreon:
----------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------
Рекомендации по теме
Комментарии
Автор

in my case I need to create headers aka column headers by config. where i will set up attrs like rowspan and colspan for some cells. you wrote in template static th tag, with data and you wrote structure but i need something like dynamic that depends on config.

assetdev
Автор

With this code I get error on 'data' argument here: var new_data = groupBy(data, 'month'); error message: Type '{ name: sting, value: string, group: string }[]' provides no match for the signature '(value: unknown): unknown'

atlaslion
Автор

How can I implement this with expandable rows?

guillermoramirez
Автор

How to you combine group by with column sort?

hayama