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
Copy file name to clipboardExpand all lines: docs/index.md
+10-6Lines changed: 10 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -192,6 +192,7 @@ attribute which should be placed along side `sf-schema`.
192
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
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
+
| setSchemaDefaults | boolean, set to false an no defaults from the schema will be set on the model. |
195
196
196
197
*formDefaults* is mostly useful for setting global [ngModelOptions](#ngmodeloptions)
197
198
i.e. changing the entire form to validate on blur.
@@ -260,6 +261,7 @@ The context variables available to you are:
260
261
| error | The error code |
261
262
| title | Title of the field |
262
263
| value | The model value |
264
+
| viewValue | The view value (probably the one you want) |
263
265
| form | form definition object for this field |
264
266
| schema | schema for this field |
265
267
@@ -622,6 +624,8 @@ General options most field types can handle:
622
624
validationMessage:"Oh noes, please write a proper address", // A custom validation error message
623
625
onChange:"valueChanged(form.key,modelValue)", // onChange event handler, expression or function
624
626
feedback:false, // Inline feedback icons
627
+
disableSuccessState:false, // Set true to NOT apply 'has-success' class to a field that was validated successfully
628
+
disableErrorState:false, // Set true to NOT apply 'has-error' class to a field that failed validation
625
629
placeholder:"Input...", // placeholder on inputs and textarea
626
630
ngModelOptions: { ... }, // Passed along to ng-model-options
627
631
readonly:true, // Same effect as readOnly in schema. Put on a fieldset or array
@@ -727,9 +731,9 @@ the surface it uses `ng-if` so the hidden field is *not* part of the form.
727
731
728
732
`condition` should be a string with an angular expression. If that expression evaluates as thruthy
729
733
the field will be rendered into the DOM otherwise not. The expression is evaluated in the parent scope of
730
-
the `sf-schema` directive (the same as onClick on buttons) but with access to the current model
731
-
and current array index under the name `model`and `arrayIndex`. This is useful for hiding/showing
732
-
parts of a form depending on another form control.
734
+
the `sf-schema` directive (the same as onClick on buttons) but with access to the current model,
735
+
current model value and current array index under the name `model`, `modelValue`and `arrayIndex`.
736
+
This is useful for hiding/showing parts of a form depending on another form control.
733
737
734
738
ex. A checkbox that shows an input field for a code when checked
0 commit comments