Does Angular Schema Form support nested array conditions

I am using the js library of the Angular Schema Form library for a project and have a schema with an array of level 3. In JSON form, I want a condition for one of the fields in a nested array. Under the conditions, the only way I know the reference to the array element in the model is to use arrayIndex, but this is just the index of the innermost array. Thus, the following condition will not work, since arrayIndex will only be the correct index for prices []:

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

Do I need to fulfill the conditions on nested arrays at all and refer to the nested array element in the model? Sort of:

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

Any help would be greatly appreciated!

+4
source share

Source: https://habr.com/ru/post/1615813/


All Articles