Skip to content

Commit b8fdc4e

Browse files
authored
Merge pull request #959 from scottux/patch-1
ArrayIndices Documentation
2 parents acd969f + 74c91e5 commit b8fdc4e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/index.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ the surface it uses `ng-if` so the hidden field is *not* part of the form.
788788
`condition` should be a string with an angular expression. If that expression evaluates as thruthy
789789
the field will be rendered into the DOM otherwise not. The expression is evaluated in the parent scope of
790790
the `sf-schema` directive (the same as onClick on buttons) but with access to the current model,
791-
current model value and current array index under the name `model`, `modelValue` and `arrayIndex`.
791+
current model value and current array index under the name `model`, `modelValue` and `arrayIndex`/`arrayIndices`.
792792
This is useful for hiding/showing parts of a form depending on another form control.
793793
794794
ex. A checkbox that shows an input field for a code when checked
@@ -869,15 +869,15 @@ function FormCtrl($scope) {
869869
"persons[].eligible",
870870
{
871871
key: "persons[].code",
872-
condition: "persons[arrayIndex].eligible", //or "model[arrayIndex].eligable"
872+
condition: "persons[arrayIndex].eligible", //or "model[arrayIndex].eligible"
873873
}
874874
]
875875
}
876876
]
877877
}
878878
```
879879
880-
Note that arrays inside arrays won't work with conditions.
880+
Arrays-in-arrays must use `arrayIndices`. e.g. `model[arrayIndices[0]].child[arrayIndices[1]].etc`.
881881
882882
883883
### destroyStrategy

0 commit comments

Comments
 (0)