I need to check/unchec checkbox with click on div "user check" and call doIfChecked(user).
I can check checkbox in ng-repeat and call doIfChecked.
var app = angular.module('app', []);
app.controller('cont', ['$scope', function($scope) {
$scope.users = {user1:1,user2:2,user3:3};
$scope.toggleUserCo = function(user) {
user.co = !user.co;
}
$scope.doIfChecked = function (array) {
}
}]);
.user_check {
width: 600px;
border: 1px solid red;
}
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div class="user_check" ng-app="app" ng-controller="cont" >
<div class="user_check" ng-app="app" ng-click="toggleUserCo()" ng-repeat="us in users">
<input type="checkbox" checklist-value="contact" checklist-model="user.co" ng-click="doIfChecked(user)"/>
</div>