angular.forEach $scope.defaultDivisionMapping = [{ "id": 10045, "lookupType": "DIVISION_MAPPING", "meaning": "采购订单取消一览表" },{ "id": 10046, "lookupType": "DIVISION_MAPPING", "meaning": "采购订单一览表" }];$scope.defau
$scope.defaultDivisionMapping = [{ "id": 10045, "lookupType": "DIVISION_MAPPING", "meaning": "采购订单取消一览表" },{ "id": 10046, "lookupType": "DIVISION_MAPPING", "meaning": "采购订单一览表" } ]; $scope.defaultMapping = filterTextMapping($scope.defaultDivisionMapping) function filterTextMapping(defaultDivisionMapping) { var defaultMapping = {}; angular.forEach(defaultDivisionMapping, function (value, key) { defaultMapping[value.lookupCode] = value.meaning; }); return defaultMapping; };