Currently, I am utilizing the editable-table jQuery plugin to enable editing in a table. This tool is simple to implement, lightweight, and highly efficient.
The markup structure for this task looks like this:
<tr ng-repeat="o in orders">
<td ng-bind="o.name"></td>
<td ng-bind="o.weight"></td>
<td ng-bind="o.dimensions"></td>
</tr>
To make the table editable, all it takes is calling the following function:
$('#ordertable').editableTableWidget();
This implementation functions smoothly: the table displays perfectly and supports editing capabilities. In case there are modifications in the data model, the table refreshes automatically.
However, using ng-bind
results in one-way binding, meaning that alterations made in the table do not reflect in the data model without manual updates. Unfortunately, employing ng-model
is not feasible as it requires an input field.
Since I am still learning Angular, I am uncertain about the appropriate method to synchronize changes back to the data model. While resolving it through plain JavaScript is possible, my preference is to stick with Angular conventions.
What would be the correct approach to update the data model accordingly?