I have created a Plunker to display data under each category, but for some reason the data is not printing correctly. For example, the value 12345 should be displayed directly under 'bread'. I am unsure of where the issue lies in my code:
$scope.allProducts = [];
angular.forEach($scope.data, function(item, index){
angular.forEach(item.products, function(item2, index){
if($scope.allProducts.indexOf(item2.consummable) == -1){
$scope.allProducts.push(item2.consummable);
}
})
})