@esfaenza/forms-and-validations 13.1.5 → 13.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1707,6 +1707,14 @@ class BaseFormControl {
1707
1707
  };
1708
1708
  }
1709
1709
  }
1710
+ /**
1711
+ * Se sono in modalità detatched devo rimuovere manualmente questo controllo quando entro nella dispose, altrimenti se poi ne andassi a riaggiungere
1712
+ * un altro con lo stesso "name" ma magari resettato, Angular lo re-idraterebbe con i valori precedenti nonostante il modello fosse vuoto
1713
+ */
1714
+ ngOnDestroy() {
1715
+ if (this.detatchedFromform && this.Form)
1716
+ this.Form.removeControl(this.validationControl);
1717
+ }
1710
1718
  /**
1711
1719
  * Elabora i validatori iniettati e capisce se il valore è obbligatorio o meno
1712
1720
  */