Skip to content

Commit b25b09b

Browse files
committed
Move sf-field to a external helper
Instead of inside the builder function.
1 parent a1e3d65 commit b25b09b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/services/builder.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ angular.module('schemaForm').provider('sfBuilder', ['sfPathProvider', function(s
1111
};
1212

1313
var builders = {
14+
sfField: function(args) {
15+
args.fieldFrag.firstChild.setAttribute('sf-field', args.path);
16+
},
1417
ngModel: function(args) {
1518
if (!args.form.key) {
1619
return;
@@ -147,9 +150,6 @@ angular.module('schemaForm').provider('sfBuilder', ['sfPathProvider', function(s
147150
tmpl.appendChild(div.childNodes[0]);
148151
}
149152

150-
151-
tmpl.firstChild.setAttribute('sf-field',path + '[' + index + ']');
152-
153153
// Possible builder, often a noop
154154
var args = {
155155
fieldFrag: tmpl,

0 commit comments

Comments
 (0)