I have the json data like below
[{
"id": 1,
"address": "MG Road",
"country": INDIA,
"state": AP,
"city": VIJ
},
{
"id": 2,
"address": "Miyapur",
"country": INDIA,
"state": TS,
"city": HYD
},
{
"id": 3,
"address": "Autonagar",
"country": INDIA,
"state": AP,
"city": VIJ
},
{
"id": 4,
"address": "Kukatpalli",
"country": INDIA,
"state": TS,
"city": HYD
},
{
"id": 5,
"address": "Koti",
"country": INDIA,
"state": TS,
"city": HYD
}
]
I want to display like below format
IND,TS,HYD
Miyapur,Koti,Kukatpalli
IND,AP,VIJ,
MG Road, Autonagar
For that im using groupBy filter like below but i was unable to group those values
here is my code
<div class="location-container">
<label ng-repeat="(key,value) in locationmodel | groupBy: '[country,state,city]'">{{key}}
</label>
<span ng-repeat="location in value">{{location.address}}</span>
</div>
But with above code i was unable to get what i'm expected. please help me in resolving this.
Thanks in advance