I\'ll preface this by saying I am very new to AngularJS so forgive me if my mindset is far off base. I am writing a very simple single page reporting app using AngularJS, th
I'm not sure I totally understand the question, but are just needing to display the total number in the object you're iterating over? Just set $scope.total
to the length of your array (bar
in your example above). So, $scope.total = $scope.bar.length;
If you're wanting the total of all the foo.baz
properties, you just need to calculate that in your controller.
$scope.total = 0;
angular.forEach($scope.bar, function(foo) {
$scope.total += foo.baz;
});