I was reading this example http://jsfiddle.net/7n8NR/3/ in this example once you click on add to list it added your entered data in Unchecked: array below with check item button and when you press check item button it pushes the values in Checked item array. This is very simple example. What I am going to trying is I have added new input text box in Unchecked: array and trying to send their value to the Checked item array but it is not updating. My working demo is here http://jsfiddle.net/7n8NR/240/
Controller:
// Add a Item to the list
$scope.addItem = function () {
$scope.items.push({
amount: $scope.itemAmount,
name: $scope.itemName,
//This one I have added
qty: $scope.qty
})
HTML:
<table>
<tr ng-repeat="item in items" class="item-unchecked">
<td><b>amount:</b> {{item.amount}} -</td>
<td><b>name:</b> {{item.name}} -</td>
/*This is one I have added*/
<td><b>qty:</b> <input type="number" ng-model="qty" /></td>
</tr>
</table>
<button ng-click="toggleChecked($index)">check item</button>
I am just attempting but don't know the correct way of doing this. Please any one can help on this. Thanks in advance.
qtystuff in that fiddle, and it's not really clear to me what "it is not updating" means.