Here is the current situation I'm dealing with in my code:
<form name="task_form" ng-app="myApp" ng-submit="tasksubmit()">
<ul class="items-list">
<li ng-repeat="task in taskslist | orderBy:orderProp">
<p>
<strong>{{task.title}}</strong>
</p>
<input type="text" ng-model="task_input_values[task.id]" >
</li>
</ul>
</form>
In the taskslist
array, if I have 100+ tasks
, it means I will also have more than 100 identical values for ng-model
on the <input type="text">
elements. Currently, I am using
ng-model="task_input_values[task.id]"
which gives me an array like {"14":"sometext here"}
. However, I'm struggling to capture both the id
, such as 14
, and the corresponding input value
like sometext here
. If you have any suggestions for a better approach or logic, please share as I am new to AngularJS.