Skip to content

Commit 46b0a0d

Browse files
committed
Fixed transclude builder path
1 parent 3f03503 commit 46b0a0d

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/services/builder.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,14 @@ angular.module('schemaForm').provider('sfBuilder', ['sfPathProvider', function(s
9090
for (var i = 0; i < transclusions.length; i++) {
9191
var n = transclusions[i];
9292

93-
// The sf-transclude attribute is not a directive, but has the name of what we're supposed to
94-
// traverse.
95-
var sub = args.form[n.getAttribute('sf-field-transclude')];
96-
if (sub) {
97-
sub = Array.isArray(sub) ? sub : [sub];
98-
var childFrag = args.build(sub, args.path + '.' + sub, args.state);
93+
// The sf-transclude attribute is not a directive,
94+
// but has the name of what we're supposed to
95+
// traverse. Default to `items`
96+
var sub = n.getAttribute('sf-field-transclude') || 'items';
97+
var items = args.form[sub];
98+
99+
if (items) {
100+
var childFrag = args.build(items, args.path + '.' + sub, args.state);
99101
n.appendChild(childFrag);
100102
}
101103
}

0 commit comments

Comments
 (0)