Skip to content

Commit 8ede6ef

Browse files
committed
Allow access to the modelValue inside a condition
Allowing access to the modelValue from inside a condition would make conditions inside nested loops and from dynamic schemas easier to work with.
1 parent 23ea369 commit 8ede6ef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/services/decorators.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ angular.module('schemaForm').provider('schemaFormDecorators',
209209
'ng-if',
210210
ngIf ?
211211
'(' + ngIf +
212-
') || (evalExpr(form.condition,{ model: model, "arrayIndex": arrayIndex }))'
213-
: 'evalExpr(form.condition,{ model: model, "arrayIndex": arrayIndex })'
212+
') || (evalExpr(form.condition,{ model: model, "arrayIndex": arrayIndex, "modelValue": model["' + form.key.join('"]["') + '"] }))'
213+
: 'evalExpr(form.condition,{ model: model, "arrayIndex": arrayIndex, "modelValue": model["' + form.key.join('"]["') + '"] })'
214214
);
215215
});
216216
}

0 commit comments

Comments
 (0)