How to group the object using groupBy in angular
rowData = [
{code: "Machine 1", date: "2019-01-19 02:00:00", assets: { PRN: 2}},
{code: "Machine 2", date: "2019-01-20 00:00:00", assets: { PRN1: 2}},
{code: "Machine 3", date: "2019-01-21 00:00:00", assets: { PRN: 2}},
{code: "Machine 4", date: "2019-01-22 00:00:00", assets: { PRN1: 2}},
{code: "Machine 5", date: "2019-01-23 00:00:00", assets: { PRN2: 2}}
]
group it into Object keys which is the PRN, PRN1, PRN2
the output should be
PRN: [{...}]
PRN1: [{...}]
PRN2: [{...}]
groupByin Angular, only in AngularJs, which is not what the tag in your question is about.array#reduceto group your data.