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
Also update error messages when model changes even if error state
hasn't changed. Also introduces two global options
Default values:
pristine : {error: true, success: true}, // Should errors and success be visible regardless of $pristine?
validateOnRender: false // Should form fields be validated on form render?
Copy file name to clipboardExpand all lines: docs/index.md
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -187,13 +187,15 @@ attribute which should be placed along side `sf-schema`.
187
187
`sf-options` takes an object with the following possible attributes.
188
188
189
189
190
-
| Attribute | |
191
-
|:--------------|:------------------------|
192
-
| supressPropertyTitles | by default schema form uses the property name in the schema as a title if none is specified, set this to true to disable that behavior |
193
-
| formDefaults | an object that will be used as a default for all form definitions |
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
-
| 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 |
190
+
| Attribute | Type | |
191
+
|:--------------|:------|:-------------------|
192
+
| supressPropertyTitles | boolean |by default schema form uses the property name in the schema as a title if none is specified, set this to true to disable that behavior |
193
+
| formDefaults | object | an object that will be used as a default for all form definitions |
194
+
| validationMessage | object or function | Object or a function that will be used as default validation message for all fields. See [Validation Messages](#validation-messages) for details. |
195
+
| setSchemaDefaults | boolean | Should schema defaults be set on model. |
196
+
| destroyStrategy | string | the default strategy to use for cleaning the model when a form element is removed. see [destroyStrategy](#destroyStrategy) below |
197
+
| pristine | Object `{errors ,success}` | Sets if errors and success states should be visible when form field are `$pristine`. Default is `{errors:true, success:true}` |
198
+
| validateOnRender | boolean | Should form be validated on initial render? Default `false` |
197
199
198
200
*formDefaults* is mostly useful for setting global [ngModelOptions](#ngmodeloptions)
199
201
i.e. changing the entire form to validate on blur.
0 commit comments