<commit_before>// js/directives/nw-category-item.directive

(function() {
  "use strict";

  angular.module("NoteWrangler")
    .directive("nwCategoryItem", nwCategoryItemDirective);

  nwCategoryItemDirective.$inject = ["Category"];

  function nwCategoryItemDirective() {
    return {
      replace: true,
      restrict: "E",
      templateUrl: "../templates/directives/nw-category-item.directive.html",
      scope: {
        category: "="
      },
      require: "^nwCategorySelect",
      link: (scope, element, attrs, nwCategorySelectCtrl) => {
        scope.makeActive = () => {
          nwCategorySelectCtrl.setActiveCategory(scope.category);
        };

        scope.categoryActive = () => {
          return nwCategorySelectCtrl.setActiveCategory(scope.category) === scope.category.name;
        };
      }
    }
  }
})();<commit_msg>Edit link function<commit_after>// js/directives/nw-category-item.directive

(function() {
  "use strict";

  angular.module("NoteWrangler")
    .directive("nwCategoryItem", nwCategoryItemDirective);

  nwCategoryItemDirective.$inject = ["Category"];

  function nwCategoryItemDirective() {
    return {
      replace: true,
      restrict: "E",
      templateUrl: "../templates/directives/nw-category-item.directive.html",
      scope: {
        category: "="
      },
      require: "^nwCategorySelect",
      link: function (scope, element, attrs, nwCategorySelectCtrl) {
        scope.makeActive = function () {
          nwCategorySelectCtrl.setActiveCategory(scope.category);
        };

        scope.categoryActive = function () {
          return nwCategorySelectCtrl.getActiveCategory() === scope.category.name;
        };
      }
    }
  }
})();
{'fraction_non_alphanumeric': 0.14034057545507928, 'fraction_numerical': 0.0, 'mean_word_length': 2.8727272727272726, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '3225591', 'n_tokens_mistral': 509, 'n_tokens_neox': 490, 'n_words': 73}