I listed input data from a form listed in HTML table using ng-repeat. I wanted to delete or update a row in the table. Please suggest how to pass the data value from a row to controller in AngularJS then how to write the edit function to change the data for this row then store back to data storage.
How to pass URL para value to AngularJS controller, edit these data, then store back to datastorage?
27 Views Asked by P. Wle At
2
There are 2 best solutions below
1
On
<!-- Here is my html part -->
<tr ng-repeat="User in Users">
<td>{{ $index + 1 }}
</td>
<td>{{ User.Userfname }}
</td>
<td>{{ User.Userlname }}
</td>
<td>{{ User.Userphone }}
</td>
<td class="pull-right">
<a ng-click="editUser(User)" href="?index={{ $index
}}&Userfname={{ User.Userfname }}&Userlname={{ User.Userlname }}&Userphone=
{{ User.Userphone }}">Update</a>
<button ng-click="deleteUser(User)">Delete</button>
</td>
</tr>
//Here is my delete function