I have this function in my Angular controller but I only want the user to be able to add 1 heart, and if they click again, it would remove the heart. How can this be accomplished?
$scope.activeClass = false;
$scope.addHeart = function(post){
post.hearts += 1;
$scope.activeClass = !$scope.activeClass;
};