Вы должны определить функцию, которая будет возвращать описание, просматривая элементы данных.
var c = angular.module('myApp',[]);
c.controller("myCtrl",function($scope){
$scope.data={
count: {
"Item 1": 10,
"Item 2" : 20,
"Item 4": 30
},
items : [{
"itemDescription": "Description 1",
"itemName": "Item 1",
},{
"itemDescription": "Description 2",
"itemName": "Item 2",
},{
"itemDescription": "Description 3",
"itemName": "Item 3",
}]
}
$scope.name = "Demo";
$scope.getDescription = (item) => {
const desc = $scope.data.items.find(i => i.itemName === item);
return desc && desc.itemDescription // for exception handling
}
})
<html>
<head>
<script data-require="angular.js@1.6.6" data-semver="1.6.6" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.6/angular.min.js"></script>
<link rel="stylesheet" href="style.css" />
<script src="script.js"></script>
</head>
<body ng-app= "myApp" ng-controller="myCtrl">
<h1>Hello Plunker!</h1>
<table border="2">
<tr>
<td>Name</td>
<td>Description</td>
<td>Count</td>
</tr>
<tr ng-repeat="(key,value) in data.count">
<td>{{key}}</td>
<td>{{getDescription(key)}}</td>
<td>{{value}}</td>
</tr>
</table>
</body>
</html>