[angularjs] Calculating sum of repeated elements in AngularJS ng-repeat

In html

<b class="text-primary">Total Amount: ${{ data.allTicketsTotalPrice() }}</b>

in javascript

  app.controller('myController', function ($http) {
            var vm = this;          
            vm.allTicketsTotalPrice = function () {
                var totalPrice = 0;
                angular.forEach(vm.ticketTotalPrice, function (value, key) {
                    totalPrice += parseFloat(value);
                });
                return totalPrice.toFixed(2);
            };
        });