I am new to angularJs. I am having a page which uses the ng-repeat to generate new records:
<tr ng-repeat="obj in objs">
<td>
<input type="text" value="{{obj.name}}" />
</td>
<td>
<input type="text" value="{{obj.amount}}" />
</td>
<td>
<input type="text" value="{{obj.status}}" />
</td>
</tr>
As they are all input fields. All of the data are writable to the customer. When submitting form, I am trying to get the updated data. Using the code below:
$scope.submitform = function(index) {
var objJson = JSON.stringify($scope.objs);
$('input[id$="objList"]').val(objJson);
saveForm();
}
But seems $scope.objs is not updated by customer input, which I can quite understand. But the problem is, how should I pass the values back to $scope.objs? I can definitely use the jQuery to do that but which might not sound very angularJs. So what is the best way in angularJs to achieve that?
ngModel?