Answer the question
In order to leave comments, you need to log in
How to form ng-model with variable inside in ng-repeat loop?
Hello! There is a form, selects must have the user group ID in the name (for example, name="TASK_5", where 5 is the group ID). To send to the server, an options array is formed with all fields, so the model name should be options.TASK_ #ID# :
<tr ng-repeat="(index, taskinmodule) in usedGroups">
<td>
<select ng-model="options.TASKS_{{taskinmodule.ID}}" name="TASKS_{{taskinmodule.ID}}">
<option value="">(по умолчанию)</option>
<option ng-repeat="task in rightsData.tasks" value="{{task.id}}" ng-selected="rightsData.taskinmodule[taskinmodule.ID].ID == task.id">{{task.name}}</option>
</select>
</td>
</tr>
Answer the question
In order to leave comments, you need to log in
To send to the server, an array of options is formed with all fields, so the model name should be options.TASK_#ID#:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question