|
@@ -2,18 +2,18 @@
|
|
|
|
|
|
A Dynamic Form Builder for Angular.
|
|
|
|
|
|
-## General options for each control
|
|
|
+## Field options
|
|
|
|
|
|
-### Common field metadata properties
|
|
|
+### Common field metadata
|
|
|
|
|
|
All fields support the following metadata. The missing properties will be 'filled oin' by dynaform's field-specific models, allowing forms to specifiued tersely.
|
|
|
|
|
|
| Property | Description | Default / Notes |
|
|
|
|-------------------- |------------------------------------------------------------------------------- |------------------------------------------------------ |
|
|
|
-| name | The FormControl name | Derived from the key of the control's metadata object |
|
|
|
-| type | The control type | Text |
|
|
|
+| name | The FormControl name - DERIVED AUTOMATICALLY | Derived from the key of the control's metadata object |
|
|
|
+| type | The control's type | Text |
|
|
|
| label | The controls's label | UnCamelCased and spaced version of name |
|
|
|
-| value | The control's initial value | Empty string |
|
|
|
+| value | The control's initial value | Empty string |
|
|
|
| checkedValue | Value when checked* | Checkboxes / Checkbuttons only |
|
|
|
| default | Default value | |
|
|
|
| placeholder | Optional placeholder text | |
|
|
@@ -28,18 +28,22 @@ All fields support the following metadata. The missing properties will be 'fille
|
|
|
| asyncValidators | Array of async validator functions - following Angular FormControl API | |
|
|
|
| valFailureMessages | Validation failure messages - display appropriate message if validation fails | |
|
|
|
|
|
|
-```
|
|
|
-{
|
|
|
- firstName: {},
|
|
|
- lastName: {},
|
|
|
- telephoneNumber: {}
|
|
|
-}
|
|
|
-```
|
|
|
-
|
|
|
### Options metadata (selects, radios, checkbutton groups, etc)
|
|
|
|
|
|
-Supply an array of values, an array of [calue, label] pairs, or an array of { value: <VALUE>, label: <LABEL> } objects. If you supply a aimple array of values, each value is used as both the value and label.
|
|
|
+Supply an array of values, an array of [value, label] pairs, or an array of { value: <VALUE>, label: <LABEL> } objects. If you supply a aimple array of values, each value is used as both the value and label.
|
|
|
+
|
|
|
+#### Available types
|
|
|
+
|
|
|
+* Text
|
|
|
+* Textarea
|
|
|
+* Select
|
|
|
+* Radio
|
|
|
+* Checkbox
|
|
|
+* Checkbutton
|
|
|
+* Password
|
|
|
+* Hidden
|
|
|
|
|
|
+#### Example
|
|
|
```
|
|
|
{
|
|
|
firstName: {},
|