<commit_before>module.exports = ngModule => {
  require('./inventory-container.component.css');

  ngModule.component('inventoryContainer', {
    template: require('./inventory-container.component.html'),
    controller: inventoryContainerCtrl,
    bindings: {
      // Inputs should use < and @ bindings.
      // Outputs should use & bindings.
    }
  });

  function inventoryContainerCtrl($q, productsFactory, globalFiltersFactory, SAMPLE_APP) {
    const ctrl = this;
    // private
    let _products = [];
    let _categories = [];

    ctrl.onSearchbarUpdate = onSearchbarUpdate;
    ctrl.filterByName = filterByName;
    ctrl.filteredProducts = [];
    ctrl.filteredCategories = [];
    ctrl.searchBarItems = [];
    ctrl.searchText = '';
    ctrl.loading = true;

    _getToolbarItems(globalFiltersFactory.getFilter());
    $q.all([_getProducts(globalFiltersFactory.getFilter()), _getCategories()]).then(() => {
      ctrl.filteredProducts = _products;
      _filterCategories(globalFiltersFactory.getFilter());
      _buildAutocompleteList();
      ctrl.loading = false;<commit_msg>refactor(inventory-container): make q.all more readable<commit_after>module.exports = ngModule => {
  require('./inventory-container.component.css');

  ngModule.component('inventoryContainer', {
    template: require('./inventory-container.component.html'),
    controller: inventoryContainerCtrl,
    bindings: {
      // Inputs should use < and @ bindings.
      // Outputs should use & bindings.
    }
  });

  function inventoryContainerCtrl($q, productsFactory, globalFiltersFactory, SAMPLE_APP) {
    const ctrl = this;
    // private
    let _products = [];
    let _categories = [];

    ctrl.onSearchbarUpdate = onSearchbarUpdate;
    ctrl.filterByName = filterByName;
    ctrl.filteredProducts = [];
    ctrl.filteredCategories = [];
    ctrl.searchBarItems = [];
    ctrl.searchText = '';
    ctrl.loading = true;

    _getToolbarItems(globalFiltersFactory.getFilter());
    const productsPromise = _getProducts(globalFiltersFactory.getFilter());
    const categoriesPromise = _getCategories();
    $q.all([productsPromise, categoriesPromise]).then(() => {
      ctrl.filteredProducts = _products;
      _filterCategories(globalFiltersFactory.getFilter());
      _buildAutocompleteList();
      ctrl.loading = false;
{'fraction_non_alphanumeric': 0.12629310344827585, 'fraction_numerical': 0.0, 'mean_word_length': 3.7464212678936604, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '2502428', 'n_tokens_mistral': 644, 'n_tokens_neox': 623, 'n_words': 109}