多個屬性我有一個像下面 [{ "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 } ]
的GroupBy與角度濾波器
我想顯示像下面格式
IND,TS JSON數據,HYD
Miyapur, Koti,Kukatpalli
IND,AP,VIJ,
MG路,Autonagar
對於使用GROUPBY過濾象下面這樣的IM,但我無法組的值
這裏是我的代碼
<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>
但隨着上面的代碼,我是無法得到我所期望的。請幫我解決這個問題。
在此先感謝
工作完美:)謝謝你這麼多 – user2451830