Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.controller('CommentController', ['$scope', '$routeParams', 'suggestions',
- function($scope, $routeParams, suggestions) {
- $scope.post = suggestions.posts[$routeParams.id];
- $scope.addComment = function() {
- var newComment = {
- body: "",
- upvote: 0
- }
- suggestions.posts.comments.push(newComment);
- }
- $scope.upvoteComment = function(index) {
- $scope.comment.upvote += 1;
- }
- }]);
Add Comment
Please, Sign In to add comment