<commit_before>var controllers = angular.module('controllers');

/* 

  Handles the filter view logic 

*/

controllers.controller('FilterCtrl', ['$scope', 'Search', 'ServicesList', '_', function ($scope, Search, ServicesList, _) {

 _.each([1, 2, 3],function(num){
  console.log(num)
 });

 var callback = function(data){
  console.dir(data);
 }
 
 ServicesList.get(callback);


  // referral required selected ? 
  // pass the result into the search service function 
  // Search.selectReferralRequired(true/false)
  $scope.referralFilter = false; 

  $scope.check = function(){
    $scope.referralFilter = !$scope.referralFilter;
  }

  // functions to apply the changes based on user selection
  $scope.applyFilter = function(){
    // applies the filter for the referral field 
    Search.selectReferralRequired($scope.referralFilter);

    //TODO:  Search.selectOrganization`

  }


}]);
<commit_msg>Made a filter method for collecting the parterName from serviceList [<NAME>ang]<commit_after>var controllers = angular.module('controllers');

/* 

  Handles the filter view logic 

*/

controllers.controller('FilterCtrl', ['$scope', 'Search', 'ServicesList', '_', function ($scope, Search, ServicesList, _) {

 // defines a function to callback function for filtering data 
  var collectPartnerNames = function(data){
    /* 

     Here we make use of methods in underscore 
      chain - returns a wrapped object & calling methods on 
              it will continue to return wrapped objects 
              (calling VALUE will return final value)

      pluck - extracting data from the objects inside the data array 
      flatten 

      unique - grabs the unique values 

    */
     $scope.parterName = _.chain(data) 
                           .pluck("properties")
                           .pluck("partnerName")
                           .unique()
                           .value();
  }
 
  // calls the ServiceList function get which takes a call back function 
  // in this case we are collecting partnerNames/Organizations
  ServicesList.get(collectPartnerNames);


  // referral required selected ? 
  // pass the result into the search service function 
  // Search.selectReferralRequired(true/false)
  $scope.referralFilter = false; 

  $scope.check = function(){
    $scope.referralFilter = !$scope.referralFilter;
  }

  // functions to apply the changes based on user selection
  $scope.applyFilter = function(){
    // applies the filter for the referral field 
    Search.selectReferralRequired($scope.referralFilter);

    //TODO:  Search.selectOrganization`

  }


}]);

{'fraction_non_alphanumeric': 0.10457516339869281, 'fraction_numerical': 0.0011534025374855825, 'mean_word_length': 2.889387144992526, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '5516835', 'n_tokens_mistral': 736, 'n_tokens_neox': 669, 'n_words': 211}