Edit in JSFiddle

<body>
    <div class="container" ng-controller="TestCrtl">
         <h1>AngularJS array sum by field/key filter example</h1>

         <h2><a target="_blank" href="http://www.cacodaemon.de/">by cacodaemon.de</a></h2>

        <table class="table table-bordered table-condensed">
            <thead>
                <tr>
                    <th>Name</th>
                    <th>Posts</th>
                    <th>Comments</th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="user in users">
                    <td>{{user.name}}</td>
                    <td>{{user.posts}}</td>
                    <td>{{user.comments}}</td>
                </tr>
            </tbody>
            <tfoot>
                <tr>
                    <th></th>
                    <th>{{users|sumByKey:'posts'}}</th>
                    <th>{{users|sumByKey:'comments'}}</th>
                </tr>
            </tfoot>
        </table>
    </div>
</body>
angular.module('exampleFilter', [])
    .filter('sumByKey', function () {
    return function (data, key) {
        if (typeof (data) === 'undefined' || typeof (key) === 'undefined') {
            return 0;
        }

        var sum = 0;
        for (var i = data.length - 1; i >= 0; i--) {
            sum += parseInt(data[i][key]);
        }

        return sum;
    };
})
    .controller('TestCrtl', function ($scope) {
    $scope.users = [{
        name: 'Kenny',
        posts: 1,
        comments: 6
    }, {
        name: 'Kyle',
        posts: 2,
        comments: 7
    }, {
        name: 'Eric',
        posts: 3,
        comments: 8
    }, {
        name: 'Stan',
        posts: 4,
        comments: 9
    }, {
        name: 'Butters',
        posts: 5,
        comments: 10
    }, ];
});