You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes from code review in #371. Reworked the default destroyStrategy to be picked up directly from globalOptions, instead of looking in formDefaults. Properly handles for the difference between the destroyStrategy declared as undefined and completely undeclared, both at the globalOptions level and the form field definition level.
Copy file name to clipboardExpand all lines: docs/index.md
+2-1
Original file line number
Diff line number
Diff line change
@@ -193,6 +193,7 @@ attribute which should be placed along side `sf-schema`.
193
193
| formDefaults | an object that will be used as a default for all form definitions |
194
194
| validationMessage | an object or a function that will be used as default validation message for all fields. See [Validation Messages](#validation-messages) for details. |
195
195
| setSchemaDefaults | boolean, set to false an no defaults from the schema will be set on the model. |
196
+
| destroyStrategy | the default strategy to use for cleaning the model when a form element is removed. see [destroyStrategy](#destroyStrategy) below |
196
197
197
198
*formDefaults* is mostly useful for setting global [ngModelOptions](#ngmodeloptions)
198
199
i.e. changing the entire form to validate on blur.
@@ -831,7 +832,7 @@ will update the model to set the field value to undefined. This can be overridde
831
832
on a field to one of null, empty string (""), undefined, or "retain". Any other value will be ignored and the default
832
833
behavior will apply. The empty string option only applies to fields that have a type of string; using the empty string
833
834
with other field types will just be set to the default destroyStrategy. If you'd like to set the destroyStrategy for
834
-
an entire form, add it to the formDefaults in the [globalOptions](#global-options)
835
+
an entire form, add it to the [globalOptions](#global-options)
0 commit comments