code: function link(scope, elem, attrs, model) {
        if (!attrs.repeatInput) {
          return;
        }
  
        scope.$watch(attrs.repeatInput, function (value) {
          // Only compare values if the second ctrl has a value.
          if (model.$viewValue !== undefined && model.$viewValue !== '') {
            model.$setValidity('repeat-input', value === model.$viewValue);
          }
        });
  
        model.$parsers.push(function (value) {
          // Mute the repeatInput error if the second ctrl is empty.
          if (value === undefined || value === '') {
            model.$setValidity('repeat-input', true);
            return value;
          }
  
          var isValid = value === scope.$eval(attrs.repeatInput);
          model.$setValidity('repeat-input', isValid);
          return isValid ? value : undefined;
        });
      }
docs: directives link definition