Guest User

Untitled

a guest
May 22nd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. app.controller('CommentController', ['$scope', '$routeParams', 'suggestions',
  2. function($scope, $routeParams, suggestions) {
  3. $scope.post = suggestions.posts[$routeParams.id];
  4. $scope.addComment = function() {
  5. var newComment = {
  6. body: "",
  7. upvote: 0
  8. }
  9. suggestions.posts.comments.push(newComment);
  10. }
  11. $scope.upvoteComment = function(index) {
  12. $scope.comment.upvote += 1;
  13. }
  14.  
  15. }]);
Add Comment
Please, Sign In to add comment