<commit_before>let formInputMatchComponent = function ($parse) {
  return {
    require: '^?form',
    restrict: 'A',
    scope: {
      formInputMatch: '@'
    },
    link: function (scope, elem, attrs, ctrl) {
      if (ctrl) {
        if(!attrs.name){
          throw new Error('Form inputs should have name attribute');
        }

        let matchInput = ctrl[scope.formInputMatch];
        let thisInput = ctrl[attrs.name];

        thisInput.$validators.formInputMatch = function(){
          return (matchInput.$viewValue === thisInput.$viewValue)
        };

        scope.$watch(getMatchValue, function(){
          matchInput.$$parseAndValidate();
          console.log(arguments)
        });

        function getMatchValue(){
          var match = matchInput;
          if(angular.isObject(match) && match.hasOwnProperty('$viewValue')){
            match = match.$viewValue;
          }
          return match;
        }
      }
    }
  };
};

export default formInputMatchComponent;<commit_msg>form-input-match: debug console.log remove<commit_after>let formInputMatchComponent = function ($parse) {
  return {
    require: '^?form',
    restrict: 'A',
    scope: {
      formInputMatch: '@'
    },
    link: function (scope, elem, attrs, ctrl) {
      if (ctrl) {
        if (!attrs.name) {
          throw new Error('Form inputs should have name attribute');
        }

        let matchInput = ctrl[scope.formInputMatch];
        let thisInput = ctrl[attrs.name];

        thisInput.$validators.formInputMatch = function () {
          return (matchInput.$viewValue === thisInput.$viewValue)
        };

        scope.$watch(getMatchValue, function () {
          matchInput.$$parseAndValidate();
        });

        function getMatchValue() {
          var match = matchInput;
          if (angular.isObject(match) && match.hasOwnProperty('$viewValue')) {
            match = match.$viewValue;
          }
          return match;
        }
      }
    }
  };
};

export default formInputMatchComponent;
{'fraction_non_alphanumeric': 0.1271647699158832, 'fraction_numerical': 0.0, 'mean_word_length': 2.1792452830188678, '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': '6644198', 'n_tokens_mistral': 555, 'n_tokens_neox': 551, 'n_words': 117}