Skip to content

Commit c95cb9c

Browse files
committed
Alternative method of determining array depth
1 parent 91b86c9 commit c95cb9c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/services/builder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ angular.module('schemaForm').provider('sfBuilder', ['sfPathProvider', function(s
111111
'.condition, { model: model, "arrayIndex": $index})';
112112
if (args.form.key) {
113113
var strKey = sfPathProvider.stringify(args.form.key);
114-
var arrayDepth = (args.path.split('.items[').length - 1);
114+
var arrayDepth = args.form.key.filter(function(e) { return e === '' }).length;
115115
var arrayIndices = '$index';
116116
for (var i = 1; i < arrayDepth; i++) {
117117
arrayIndices = Array(i + 1).join('$parent.') + '$index,' + arrayIndices;

0 commit comments

Comments
 (0)