angular.js icon indicating copy to clipboard operation
angular.js copied to clipboard

Parent Form not able to evaluate dynamically generated nested forms

Open shahzadc opened this issue 13 years ago • 2 comments

I have created a parent form, and within it created dynamically generated nested forms using a directive.

The parentForm.$error object is able to evaluate errors that are immediately within the form and even within a nested form; however, the parentForm.$error does not see any of the errors that are generated for DYNAMICALLY GENERATED nested forms.

I've created a plunker to demonstrate:

http://plnkr.co/edit/zgQkSzpc9Qcvtm26nlSv?p=preview

shahzadc avatar Aug 13 '13 17:08 shahzadc

There are a few issues here:

  1. The new form element is not compiled, so the form is never known to the parent
  2. The child form must be in the DOM to be able to find the parent form
  3. replaceWith seems to do something strange here, as the element inside the link function is still the div, and compiling it fails as it is not in the DOM, and even if you simply append it to the element, and compile it, it still is not in the parent form

Narretz avatar Jul 10 '14 17:07 Narretz

I've closed this due to lack of response. Feel free to reopen with more information.

Narretz avatar Sep 19 '14 11:09 Narretz