Skip to content

Commit 7948e1b

Browse files
committed
Updated array docs with startEmpty
This fixes #120
1 parent 95226d9 commit 7948e1b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docs/index.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,9 @@ need the reordering.
836836
In the form definition you can refer to properties of an array item by the empty
837837
bracket notation. In the `key` simply end the name of the array with `[]`
838838
839+
By default the array will start with one *undefined* value so that the user is presented with one a
840+
form, to supress this the attribute `startEmpty` to `true`
841+
839842
Given the schema:
840843
```json
841844
{
@@ -888,7 +891,7 @@ function FormCtrl($scope) {
888891
889892
Example with sub form, note that you can get rid of the form field the object wrapping the
890893
subform fields gives you per default by using the `items` option in the
891-
form definition.
894+
form definition, also example of `startEmpty`.
892895
893896
```javascript
894897
function FormCtrl($scope) {
@@ -926,7 +929,8 @@ function FormCtrl($scope) {
926929
"subforms[].nick",
927930
"subforms[].name",
928931
"subforms[].emails",
929-
]
932+
],
933+
startEmpty: true
930934
}
931935
];
932936
}

0 commit comments

Comments
 (0)