Adds in new util directive isolate-form used for nested forms that you do not want dirty to propogate upwards to parent forms

This commit is contained in:
Warren
2018-09-04 11:34:10 +01:00
parent 5b3b160f3b
commit 0ea2682661
2 changed files with 11 additions and 1 deletions

View File

@@ -0,0 +1,10 @@
angular.module("umbraco.directives")
.directive('isolateForm', function ($window, $timeout, windowResizeListener) {
return {
restrict: 'A',
require: ['form', '^form'],
link: function(scope, element, attrs, forms) {
forms[1].$removeControl(forms[0]);
}
}
});

View File

@@ -1,6 +1,6 @@
<div data-element="dropzone" class="umb-file-dropzone-directive">
<ng-form name="uploadForm">
<ng-form name="uploadForm" isolate-form>
<!-- Drag and drop files area -->
<div ngf-drop