             $scope.task.comments = []
           $scope.task.comments.unshift response
           $scope.comment.text = ""
+          analyticsService.event "View Task Comments", "Add new comment"
         (response) ->
           alertService.add("danger", response.data.error, 2000)
 

  scope:
    project: "=project"
    task: "=task"
  controller: ($scope, $modal, $state, TaskFeedback, TaskComment, Task, Project, taskService, alertService, projectService) ->
    #
    # Comment code
    #

      TaskComment.delete { project_id: $scope.project.project_id, task_definition_id: $scope.task.task_definition_id, id: id },
        (response) ->
          $scope.task.comments = $scope.task.comments.filter (e) -> e.id != id
          analyticsService.event "View Task Comments", "Delete existing comment"
        (response) ->
          alertService.add("danger", response.data.error, 2000)
)
