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

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

//populates select options
  self.subTopicObject = DataFactory.subTopicObject;
//displays specific subtopic ideas to view
   self.subtopicIdeas1 = DataFactory.subtopicIdeas1;

//redirect to home view
  function homeView() {
    $location.path('/home');
  }//end of homeView()
//redirect to add idea view
  self.createIdea = function() {
//redirect after submission
    $location.path('/idea');
  }

  var userMatchObject = DataFactory.userMatchObject.list;
  self.addNewIdea = function(idea) {
  //sources firebaseUser in the function
    var auth = $firebaseAuth();
    var firebaseUser = auth.$getAuth();
  //container to loop id's through
    var id = "";
  //loops through all users email to find correct id
      for (var i = 0; i < userMatchObject.length; i++) {
        if (userMatchObject[i].email == firebaseUser.email) {
          var id = userMatchObject[i].id;
        }//end of if
      };//end of for loop
  //name and email is added to object
    var newIdea = {
      name : firebaseUser.displayName,
      email : firebaseUser.email,
      subtopicId : idea.subtopicId,
      title : idea.title,
      description : idea.description,
      id : id
    }
  //sents object to factory
    DataFactory.addNewIdea(newIdea);
  //empties inputs on submit
    self.idea = {};
  //redirect after submit
    homeView();
  }//end of self.createIdea()

}]);//end of app.controller()<commit_msg>resolved issue with comments redirect on an idea<commit_after>app.controller('Subtopic1Controller', ['DataFactory', '$firebaseAuth','$http', '$location', function(DataFactory, $firebaseAuth, $http, $location){

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

//populates select options
  self.subTopicObject = DataFactory.subTopicObject;
//displays specific subtopic ideas to view
   self.subtopicIdeas1 = DataFactory.subtopicIdeas1;

//redirect to home view
  function homeView() {
    $location.path('/home');
  }//end of homeView()
//redirect to add idea view
  self.createIdea = function() {
//redirect after submission
    $location.path('/idea');
  }

  var userMatchObject = DataFactory.userMatchObject.list;
  self.addNewIdea = function(idea) {
  //sources firebaseUser in the function
    var auth = $firebaseAuth();
    var firebaseUser = auth.$getAuth();
  //container to loop id's through
    var id = "";
  //loops through all users email to find correct id
      for (var i = 0; i < userMatchObject.length; i++) {
        if (userMatchObject[i].email == firebaseUser.email) {
          var id = userMatchObject[i].id;
        }//end of if
      };//end of for loop
  //name and email is added to object
    var newIdea = {
      name : firebaseUser.displayName,
      email : firebaseUser.email,
      subtopicId : idea.subtopicId,
      title : idea.title,
      description : idea.description,
      id : id
    }
  //sents object to factory
    DataFactory.addNewIdea(newIdea);
  //empties inputs on submit
    self.idea = {};
  //redirect after submit
    homeView();
  }//end of self.createIdea()

  //get moreComments button click
    self.moreComments = function() {
      console.log('comments clicked');
      $location.path('/comment');
    }

}]);//end of app.controller()
{'fraction_non_alphanumeric': 0.12672018348623854, 'fraction_numerical': 0.0022935779816513763, 'mean_word_length': 3.1486325802615935, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1080059', 'n_tokens_mistral': 1072, 'n_tokens_neox': 1042, 'n_words': 303}