<commit_before>function ProjectsCtrl(AppSettings, AccountService, ProjectService, projects) {
  'ngInject';

  // ViewModel
  const vm = this;
  const config = AppSettings;

  vm.title = 'Projects';
  vm.projects = projects;
  vm.config = config;
  vm.me = null;
  vm.searchInput = '';
  vm.hasSearched = false;

  vm.search = () => {
    if (vm.searchInput) {
      ProjectService.search(vm.searchInput)
        .then(result => {
          vm.projects = result;
          vm.hasSearched = true;
        });
    }
  }

  vm.clear = () => {
    ProjectService.index()
      .then(result => {
        vm.proposals = result;
        vm.hasSearched = false;
        vm.searchInput = '';
      });
  }


  vm.userIsPartOf = (project) => {
    return vm.me && vm.me.projects.some(p => {
      return p.id == project.id;
    });
  }

  if (window.user) {
    AccountService.me()
      .then(me => {
        vm.me = me;
      });
  }

}

export default {
  name: 'ProjectsCtrl',
  fn: ProjectsCtrl
};<commit_msg>Project search clear button fixed, now working<commit_after>function ProjectsCtrl(AppSettings, AccountService, ProjectService, projects) {
  'ngInject';

  // ViewModel
  const vm = this;
  const config = AppSettings;

  vm.title = 'Projects';
  vm.projects = projects;
  vm.config = config;
  vm.me = null;
  vm.searchInput = '';
  vm.hasSearched = false;

  vm.search = () => {
    if (vm.searchInput) {
      ProjectService.search(vm.searchInput)
        .then(result => {
          vm.projects = result;
          vm.hasSearched = true;
        });
    }
  }

  vm.clear = () => {
    ProjectService.index()
      .then(result => {
        vm.projects = result;
        vm.hasSearched = false;
        vm.searchInput = '';
      });
  }


  vm.userIsPartOf = (project) => {
    return vm.me && vm.me.projects.some(p => {
      return p.id == project.id;
    });
  }

  if (window.user) {
    AccountService.me()
      .then(me => {
        vm.me = me;
      });
  }

}

export default {
  name: 'ProjectsCtrl',
  fn: ProjectsCtrl
};
{'fraction_non_alphanumeric': 0.15245098039215688, 'fraction_numerical': 0.0, 'mean_word_length': 2.1351766513056836, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '4986262', 'n_tokens_mistral': 706, 'n_tokens_neox': 689, 'n_words': 128}