6
Hello, folks maybe my question is not enlightening, but I’ll try to enlighten here. I have a code in Angularjs and html, if it is a form, which receives the data in array/json format, and populates this form, with an ng-repeat, what I need to do is to take these fields created with ng-repeat and send to the server when submitting this same form. The code is this:
<form ng-submit="moviments.save()">
<table>
<tr ng-repeat="colletion in moviments.data">
<td><input type="hidden" ng-model="colletion.id"></td>
<td><input type="text" ng-model="colletion.data"></td>
<td><input type="text" ng-model="colletion.description"></td>
<td><input type="text" ng-model="colletion.value"></td>
</tr>
</table>
<button type="submit" >Enviar</button>
</form>
"moviments" is a reference to the controller responsibly, I have tried to add in ng-model this reference, thus:
<td><input type="text" ng-model="moviments.colletion.data"></td>
but in this way ng-repeat does not iterate the data array.
If anyone could shed some light, I’d really appreciate it
You want to send, through Submit, only the data of a single Object, is that it? For example, send only what is inside the Collection of one of the ngRepeat iterations, correct?
– celsomtrindade