Good day! There is an array of approximately this content, obtained from the backend
[ { 'first': 1 }, { 'second': 2, { 'third': 3 } ] I bring it not the page
<div ng-repeat="d in ctrl.data"> <div ng-repeat="(key, value) in d"> {{key}} <input ng-model="value"/> </div> </div> <button ng-click="ctrl.updateData()">zhmyak</button> I get the output in the form of text - input with value. Next I want to fix the value in the input and send back to the backend
The controller looks like this:
function myController(apiResource) { var vm = this; vm.data = []; vm.updateData = updateData; getData(); function getData() { return apiResource.stats.get().$promise.then( function (data) { vm.data = data['stats'] } ) } function updateData() { return apiResource.stats.put( {stats: vm.data} ) } } When correcting the value in the input and trying to send it back, the original values (not corrected) are sent. How to force to send updated data?