(function () {
  'use strict';

  RAML.Directives.nullForm = function() {
    return {
      restrict: 'A',
      require: '?form',
      link: function link(scope, element, iAttrs, formController) {
        if (! formController) {
          return;
        }

        // Remove this form from parent controller
        var parentFormController = element.parent().controller('form');
        if(parentFormController) {
          parentFormController.$removeControl(formController);

          // Replace form controller with a "null-controller"
          var nullFormCtrl = {
            $addControl: angular.noop,
            $removeControl: angular.noop,
            $setValidity: angular.noop,
            $setDirty: angular.noop,
            $setPristine: angular.noop
          };

          angular.extend(formController, nullFormCtrl);
        }
      }
    };
  };

  angular.module('RAML.Directives')
    .directive('nullForm', RAML.Directives.nullForm);
})();

@@ -490,287 +490,1048 @@
     
-// Replace form controller with a %22null-controller%22%0A          var nullFormCtrl = %7B%0A            $addControl: angular.noop,%0A            $removeControl: angular.noop,%0A            $setValidity: angular.noop,%0A            $setDirty: angular.noop,%0A            $setPristine: angular.noop
+if ( !parentFormController )%0A          %7B%0A            return; // root form, no need to isolate%0A          %7D%0A%0A          // Do a copy of the controller%0A          var originalCtrl = %7B%7D;%0A          angular.copy( formController, originalCtrl );%0A%0A          // Replace form controller with a %22null-controller%22%0A          var nullFormCtrl = %7B%0A            $setValidity   : function ( validationToken, isValid, control ) %7B%0A              originalCtrl.$setValidity( validationToken, isValid, control );%0A              parentFormController.$setValidity( validationToken, true, formController );%0A            %7D,%0A            $setDirty      : function () %7B%0A              element.removeClass( 'ng-pristine' ).addClass( 'ng-dirty' );%0A              formController.$dirty = true;%0A              formController.$pristine = false;%0A            %7D,%0A            $setPristine   : function () %7B%0A              element.addClass( 'ng-pristine' ).removeClass( 'ng-dirty' );%0A              formController.$dirty = false;%0A              formController.$pristine = true;%0A            %7D
 %0A   

fix validation in null-form