angular.module('angular.bootstrap.validator', ['ui.bootstrap'])
  .directive('abvIdentical', function() {
    return {
      scope: {
        targetModel: '=abvIdentical'
      },
      require: 'ngModel',
      link: function(scope, element, attributes, ngModel) {

        ngModel.$validators.abvIdentical = function(modelValue) {
          return modelValue == scope.targetModel;
        };

        scope.$watch("targetModel", function() {
          ngModel.$validate();
        });
      }

    };
  })
  .directive('abvDifferent', function() {
    return {
      scope: {
        targetModel: '=abvDifferent'
      },
      require: 'ngModel',
      link: function(scope, element, attributes, ngModel) {

        ngModel.$validators.abvDifferent = function(modelValue) {
          return modelValue != scope.targetModel;
        };

        scope.$watch("targetModel", function() {
          ngModel.$validate();
        });
      }

    };
  })
  .directive('abvForm', function($compile) {
    return {
      compile: (element, attrs) => {
        return {
          pre: (scope, element, attr, controller) => {
            var formName = attr.name;
            var formNameSubmittedAnd = formName + '.$submitted && ';

            element.find('button[type="submit"]').attr("ng-disabled", formNameSubmittedAnd + formName + '.$invalid');
            element.attr('novalidate', 'novalidate');

            // for each form-control in a form group
            element.find('.form-group').each((index, formGroup) => {
              var controls = $(formGroup).find('.form-control');
              // Only input text areas should have feedback, textarea must not have feedback
              // only support one control per form-group as per Bootstrap CSS examples
              if (controls.length == 1) {
                // set the name. and ng-model appropriately
                var control = $(controls[0]);
                var controlName = control.attr('name');
                if (!controlName) {
                  controlName = control.attr('id');
                  control.attr('name', controlName);
                }
                if (!control.attr('ng-model') && !control.attr('data-ng-model')) {
                  control.attr('ng-model', controlName);
                }

                // add feedback icons
                if ($(formGroup).hasClass('has-feedback')) {
                  control.after('<span class="glyphicon glyphicon-ok form-control-feedback" ng-show="' + formNameSubmittedAnd + formName + '.' + controlName + '.$valid' + '" aria-hidden="true"></span>');
                  control.after('<span class="glyphicon glyphicon-remove form-control-feedback" ng-show="' + formNameSubmittedAnd + formName + '.' + controlName + '.$invalid' + '" aria-hidden="true"></span>');
                }

                // ng-class="{ 'has-error': userForm.email.$invalid }
                $(formGroup).attr('ng-class', '{"has-error": ' + formNameSubmittedAnd + formName + '.' + controlName + '.$invalid }');
                // help blocks for error messages
                $(formGroup).find('.help-block[data-abv-error],.help-block[abv-error]').each((index, helpBlock) => {
                  var errorField = $(helpBlock).attr('data-abv-error');
                  if (!errorField) {
                    errorField = $(helpBlock).attr('abv-error');
                  }
                  $(helpBlock).attr('ng-show', formNameSubmittedAnd + formName + '.' + controlName + '.$error.' + errorField);
                });
              }
            });
            // disable native form validation because the validation is handled by Angular
            $compile(element.contents())(scope);
          },
          post: (scope, element, attr, controller) => {
            var formName = attr.name;
            var formNameSubmittedAnd = formName + '.$submitted && ';
            // disable submit buttons when the form is invalid after submit
          }
        };
      }
    };
  });
@@ -1,16 +1,99 @@
+var NG_HIDE_CLASS = 'ng-hide';%0Avar NG_HIDE_IN_PROGRESS_CLASS = 'ng-hide-animate';%0A%0A
 angular.module('
@@ -127,22 +127,8 @@
 ', %5B
-'ui.bootstrap'
 %5D)%0A 
@@ -1068,24 +1068,69 @@
    return %7B%0A
+      require: 'form',%0A      terminal: true,%0A
       compil
@@ -1245,37 +1245,44 @@
  var formName = 
-att
+controlle
 r.
+$
 name;%0A          
@@ -1341,16 +1341,92 @@
  && ';%0A%0A
+            // disable submit buttons when the form is invalid after submit%0A
         
@@ -2665,36 +2665,34 @@
 ol-feedback%22 ng-
-show
+if
 =%22' + formNameSu
@@ -2879,20 +2879,18 @@
 ack%22 ng-
-show
+if
 =%22' + fo
@@ -3011,78 +3011,8 @@
  %7D%0A%0A
-                // ng-class=%22%7B 'has-error': userForm.email.$invalid %7D%0A
     
@@ -3192,16 +3192,17 @@
 essages%0A
+%0A
         
@@ -3671,35 +3671,200 @@
   %7D%0A            
-%7D);
+  //                          element.unbind();%0A            %7D);%0A            //       element.removeAttr('abv-form');%0A            //$compile(element.contents())(scope);%0A
 %0A            // 
@@ -3943,57 +3943,8 @@
 lar%0A
-            $compile(element.contents())(scope);%0A
     
@@ -4131,71 +4131,44 @@
     
-// disable submit buttons when the form is invalid after submit
+$compile(element.contents())(scope);
 %0A   

Prevented double compilation by adding terminal: true