<commit_before>'use strict';

angular.module('appApp')
  .directive('controls', [ 
    '$mdSidenav',
    'configuration',
    '$rootScope',
    '_',
    'dataService',
    function ($mdSidenav, conf, $rootScope, _, ds) {
    return {
      templateUrl: 'views/controls.html',
      restrict: 'E',
      scope: {
          languages: '=',
          countries: '='
      },
      link: function postLink(scope) {
          scope.resourceTypes = ds.datasets.resourceTypes;

          scope.filter = function(resource) {
            var resp = ds.filter(resource);
            scope.languages = resp.languages;
            scope.countries = resp.countries;
          };

      }
    };
  }]);<commit_msg>debounce the filter<commit_after>'use strict';

angular.module('appApp')
  .directive('controls', [ 
    'dataService',
    '$timeout', 
    function (ds, $timeout) {
    return {
      templateUrl: 'views/controls.html',
      restrict: 'E',
      scope: {
          languages: '=',
          countries: '='
      },
      link: function postLink(scope) {
          scope.resourceTypes = ds.datasets.resourceTypes;

          scope.filter = function(resource) {
              $timeout(function() {
                  var resp = ds.filter(resource);
                  scope.languages = resp.languages;
                  scope.countries = resp.countries;
              }, 200);
          };

      }
    };
  }]);
{'fraction_non_alphanumeric': 0.14245216158752658, 'fraction_numerical': 0.002126151665485471, 'mean_word_length': 1.8582995951417005, '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': '4539024', 'n_tokens_mistral': 416, 'n_tokens_neox': 407, 'n_words': 70}