How to send objcet with unchecked model list
http://angularjs.org/
HTML
<script src="http://code.angularjs.org/angular-1.0.1.js"></script>
<div ng-controller="MyCtrl">
<table class="table">
<thead class="table-inverse">
<tr>
<th>Table Name</th>
<th>Charts</th>
<th>FlexSheet</th>
<th>Dtf</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="table in tablesData">
<td>{{table.table_name}}</td>
<td><input type="checkbox" ng-init="table.charts == 0" ng-true-value="1" ng-false-value='0' ng-checked="table.charts == 1" ng-model="table.charts"></td>
<td><input type="checkbox" ng-init="" ng-true-value="1" ng-false-value='0' ng-checked="table.flex_sheet == 1" ng-model="table.flex_sheet"></td>
<td><input type="checkbox" ng-init="" ng-true-value="1" ng-false-value='0' ng-checked="table.dtf == 1" ng-model="table.dtf"></td>
</tr>
</tbody>
</table>
<input type="button" class="btn btn-info" value="submit" ng-click="upadateTableInfo()">
</div>
JavaScript
var myApp = angular.module('myApp',[]);
//myApp.directive('myDirective', function() {});
//myApp.factory('myService', function() {});
function MyCtrl($scope) {
$scope.tablesData = [
{
"table_name": 'table1',
"charts": 0,
"flex_sheet": 0,
"dtf": 0
},{
"table_name": 'table2',
"charts": 1,
"flex_sheet": 1,
"dtf": 1
},{
"table_name": 'table3'
},{
"table_name": 'table4'
},
{
"table_name": 'table5'
},
{
"table_name": 'table6'
}];
$scope.upadateTableInfo = function() {
console.log( $scope.tablesData);
//$http.post('/chart/data',$scope.tableData).then(successCallback, //errorCallback);
}
}