Elio Chamy Elio Chamy - 2 months ago 7
HTML Question

Angularjs push table row to another table

I have 2 tables i want to push the row of the first table to the second.
table 1 :

<table>

<tr ng-repeat="row in items">
<td>{{row.PRODUCTDESCRIPTION}}</td>
<td><input type="text" ng-model="quantity[$index]"></td>
</tr>
</table>
<button ng-click="pushRows(row)"> </button>


table 2 :

<table>
<tr ng-repeat="row in products">
<td>{{row.PRODUCTDESCRIPTION}}</td>
<td><input type="text" ng-model="quantity[$index]"></td>
</tr>


i need to push the row in table 1 to the table 2 (my problem is how to push the input type text with its value)

Answer

You can use ng-model and create a new property on all the items.

plunker Example

Comments