I've got a simple upVote/downVote counter. It works great on the downvote, but when you click upvote it appends a 1 onto the end of the original upvote variable. (it Doesn't add, it Appends) but only for the upvote. Why is this and how can I fix it?
<span>
<a ng-click="upCount = upCount + 1" ng-init="upCount=location.upVoteCount"
class="btn btn-success">{{upCount}}
</a>
<a ng-click="downCount = downCount - 1" ng-init="downCount=location.downVoteCount"
class="btn btn-danger">{{downCount}}
</a>
</span>
Note: both location.upVoteCount and location.downVoteCount are defined as integers. They are populated using ng-repeat="location in locationList". So their values are not explicitly declared in the controller. Changing the + to a - works just fine, the add function also works if you replace location.upVoteCount (or location.downVoteCount) with a number.
Thanks for your help!