I am trying to groupby an array of objects w.r.t to one property of the object. What is the best way to acheive it? sample:
{
name: "India",
capital: "New Delhi",
cities:[{
name: "city1",
state:"state1"
},
{
name:"city3",
state:"state2"
}
....
{
name:"city56",
state:"state1"
}]
}
What's the best way to display it grouped by state? Should I use pipes or group the array using typescipt? Is there grouping pipe available in angular4?