/**
* 城市去重
* */
MetronicApp.service('CollectionUtils', ['$cacheFactory', '$location', function ($cacheFactory, $location) {
this.removeDuplicate = function (dataList) {
var flagList = [];
var cityIdList = [];
angular.forEach(dataList, function (item) {
if (flagList.indexOf(item.id) < 0) {
flagList.push(item.id);
cityIdList.push({
'province': item.province,
'city': item.city,
'county': item.county,
'cityId': item.id,
});
}
});
return cityIdList;
}
this.notChangedField = function(oldList,newList,field){
var length = oldList.length;
for(var i=0;i<length;i++){
if(oldList[i][field] != newList[i][field]){
return false;
}
}
return true;
}
}]);