<commit_before>
app.controller('CommentController', ['$firebaseAuth', '$http', '$location', 'DataFactory', '$routeParams', function($firebaseAuth, $http, $location, DataFactory, $routeParams){

  var self = this;
  var auth = $firebaseAuth();
  var firebaseUser = auth.$getAuth();


//shows all comments from BD to view(migth not need the two lines below)
  self.commentsObject = DataFactory.commentsObject;
  self.allSubcommentsObject = DataFactory.allSubcommentsObject;

//come form DB
  self.getIdeaIdObject = DataFactory.getIdeaIdObject;
  self.getCommentIdObject = DataFactory.getCommentIdObject;

//two lines below do data request to DB for specific idea ID
  var subtopicIdea = $routeParams;
  DataFactory.getIdeaId(subtopicIdea);

//add comment to comment to DB
  self.commentRedirect = function() {
//redirect after submission
    $location.url('/home');
  }//end of self.commentRedirect()


//adds new comment to DB (need to add firebase id into the line below)
self.addComment = function(comment) {
  console.log('comment ', comment);
  var newComment = {
          description : comment.description,
          idea_id : subtopicIdea.id,
          // user_id : need to put the firebase id in here when that works
        }
//sents comment from view to DB
  DataFactory.addComment(newComment);
//empties inputs after submission
  self.newComment = {};
//redirect after submission
  $location.url('/comment/?');
}//end of self.addComment()


  self.createIdea = function() {
//redirect after submission
    $location.path('/idea');
  }

//shows and hides sun-comment text area
  self.showComment = false;
//sub-comment button click function
  self.showCommentArea = function(){
    // console.log("button clicked");
    self.showComment = true;
  }
<commit_msg>comments now appear on dom correctly<commit_after>
app.controller('CommentController', ['$firebaseAuth', '$http', '$location', 'DataFactory', '$routeParams', function($firebaseAuth, $http, $location, DataFactory, $routeParams){

  var self = this;
  var auth = $firebaseAuth();
  var firebaseUser = auth.$getAuth();


//shows all comments from BD to view(migth not need the two lines below)
  self.commentsObject = DataFactory.commentsObject;
  self.allSubcommentsObject = DataFactory.allSubcommentsObject;

//come form DB
  self.getIdeaIdObject = DataFactory.getIdeaIdObject;
  self.getCommentIdObject = DataFactory.getCommentIdObject;

//two lines below do data request to DB for specific idea ID
  var subtopicIdea = $routeParams;
  DataFactory.getIdeaId(subtopicIdea);

//add comment to comment to DB
  self.commentRedirect = function() {
//redirect after submission
    $location.url('/home');
  }//end of self.commentRedirect()


//adds new comment to DB (need to add firebase id into the line below)
self.addComment = function(comment) {
  console.log('comment ', comment);
  var newComment = {
          description : comment.description,
          idea_id : subtopicIdea.id,
          // user_id : need to put the firebase id in here when that works
        }
//sents comment from view to DB
  DataFactory.addComment(newComment);
//empties inputs after submission
  self.newComment = {};
//redirect after submission
  $location.url('/home');
}//end of self.addComment()


  self.createIdea = function() {
//redirect after submission
    $location.path('/idea');
  }

//shows and hides sun-comment text area
  self.showComment = false;
//sub-comment button click function
  self.showCommentArea = function(){
    // console.log("button clicked");
    self.showComment = true;
  }

{'fraction_non_alphanumeric': 0.11579539066891512, 'fraction_numerical': 0.0, 'mean_word_length': 3.9361997226074896, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2005730', 'n_tokens_mistral': 1046, 'n_tokens_neox': 1016, 'n_words': 315}