<button ng-click="toggleActive()" ng-class="{active:drink.active}">{{drink.price}}</button>
var drinksApp = angular.module('drinksApp',[]);
drinksApp.controller('drinkListController',
function drinkListController($scope) {
$scope.drinks = [];
$scope.toggleActive = function(d){
d.active = !d.active;
};
$scope.money = 0;
$scope.$watch('money', function () {
angular.forEach($scope.drinks, function(d){
if (d.active){
money = money + d.price;
}
});
});
});