I have a json file like this:
[
{
"id": "1",
"name": "John",
"country": "Philippines"
},
{
"id": "2",
"name": "Marsha",
"country": "Philippines"
},
{
"id": "3",
"name": "Peter",
"country": "Philippines"
},
{
"id": "4",
"name": "Kang",
"country": "Philippines"
}
]
What I want is to display it in using ng-repeat but since all the countries are the same, I want to display the country only once. How can I possibly do that? My html file is like:
<div ng-repeat="item in citizens">
<label class="col-md-4 control-label" ng-model="item.id">
{{item.id}}
</label>
<label class="col-md-4 control-label" ng-model="item.name">
{{item.name}}
</label>
<label class="col-md-4 control-label" ng-model="item.country">
{{item.country}}
</label>
</div>
Thanks for any help.