4

I'm using the Angular Schema Form js library for a project and have a schema with a 3 level deep array. In the form JSON I want a condition on one of the fields in the nested array. In conditions the only way I know to reference an array element in the model is to use arrayIndex but that is just the index of the inner most array. So the following condition will not work as arrayIndex will only be the correct index for prices[]:

"condition": " model.products[arrayIndex].versions[arrayIndex].prices[arrayIndex].currency == 'USD'"

Is there anyway to perform conditions on nested arrays and reference the nested array element in the model? Something like:

"condition": " model.products[parent.parent.arrayIndex].versions[parent.arrayIndex].prices[arrayIndex].currency == 'USD'"

Any help would be greatly appreciated!!

Joel Kent
  • 236
  • 2
  • 5

0 Answers0