desergik, вот ка нужно делать тестовые примеры...
<!DOCTYPE html>
<html>
<head>
<script src="https://code.angularjs.org/1.3.9/angular.min.js"></script>
<!--
<script src='http://code.jquery.com/jquery-latest.js'></script>
<script src="https://code.angularjs.org/1.3.9/angular-route.js"></script>
<link rel='stylesheet type=text/css href=tmp.css' />
-->
<style type='text/css'>
</style>
<script type='text/javascript'>
angular.module('test', [])
.controller(
'ctrl',
[
'$scope',
'$http',
ctrl
]
);
function ctrl($scope,$http) {
$scope.items = [
{id: 0, name: 'Target 0', close: false},
{id: 1, name: 'Target 1', close: false},
{id: 2, name: 'Target 2', close: false}
];
$scope.status=function (Obj){
alert(Obj.id + ' = ' + Obj.close);
// тут отправляй запрос на сервер
/*
$http.get(<url>).success(function(data) {
alert('Ok');
});
*/
};
}
</script>
</head>
<body ng-app="test">
<div ng-controller="ctrl">
<ul>
<li ng-repeat='item in items'>
<span>{{item.name}}</span>
<label>
<input type='checkbox' ng-model='item.close' ng-change='status(item)' />
Close
</label>
</li>
</ul>
</div>
</body>
</html>