Skip to content

Commit e4b53ce

Browse files
authored
Merge pull request #906 from Deklin/bugfix-builder
port condition loop from development branch for IE fix
2 parents 4c26383 + 526b4a8 commit e4b53ce

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/services/builder.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,19 @@ angular.module('schemaForm').provider('sfBuilder', ['sfPathProvider', function(s
126126
}
127127

128128
var children = args.fieldFrag.children || args.fieldFrag.childNodes;
129+
var child;
130+
var ngIf;
129131
for (var i = 0; i < children.length; i++) {
130-
var child = children[i];
131-
var ngIf = child.getAttribute('ng-if');
132-
child.setAttribute(
133-
'ng-if',
134-
ngIf ?
135-
'(' + ngIf +
136-
') || (' + evalExpr + ')'
137-
: evalExpr
138-
);
132+
child = children[i];
133+
ngIf = false;
134+
135+
if (child.hasAttribute && child.hasAttribute('ng-if')) {
136+
ngIf = child.getAttribute('ng-if');
137+
};
138+
139+
if (child.setAttribute) {
140+
child.setAttribute('ng-if', ngIf ? '(' + ngIf + ') || (' + evalExpr + ')' : evalExpr);
141+
};
139142
}
140143
}
141144
},

0 commit comments

Comments
 (0)