I have some form_elements
which I use for ng-repeat, I have some question.fields
which holds all fields for the nested loop.
For the binding of the form element (and the submission to the backend) I use a pregenerated array with objects:
review.values = []
obj = {};
obj['qid'] = question_id
obj['field_type'] = field_type
obj['val'] = ""
review.values.push(obj)
<div ng-repeat="element in form_elements">
<div ng-repeat="field in element.question.fields">
<label><input type="radio" ng-model="review.values[$parent.$index*review.values.length].val" value="someval"> MyLabel</label>
</div>
</div>
I don't know how to bind the correct review.values[xyz].val
entry in the second loop?
review values
is finally the array that gets saved.
I tried already with an helper function, that gets for me the right entry of review.values with the question_id without success.
Thanks, for any help.
Patrick