Not able to display correct data in table -AngularJS
问题 Below is my plunker where I have tried to display the data under each category.But the data are not printing as supposed to .Example:-rom value 12345 should come directly under bread. I'm not sure where I'm doing wrong 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); } }) }) Creating a table matrix