Hello guys i have some question about $scope and json parse with angular.
I have function they send to api +1 when someone click on like. Easy like count. But when i trying Increment this value: where my mistake? Angular just concatenate value +1 Example i have 6 when i click they show 61 again click 611
<button class="place-button col-33" ng-if="usermeta.like_post" ng-click="like(post.id); post.likes = post.likes + 1">
<span class="col-50">
<i class="fa fa-beer"></i>
</span>
<span class="col-50">
{{likes}}
</span>
</button>
This how i get my pot from controller and service
PostService.getPost(postId).then(function(data) {
scope.post = data.post;
})
When i try this without get data from Json API it's work but with them no!
+post.likes + 1orNumber(post.likes) + 1orparseInt(post.likes) + 1or whatever…