title: Checklist-model in Angular usage
body: <p>i have departments as a title and employees as a subtitle. what i want to do is when the user check the title or department all employees or subtitles should be checked.  i am using fieldset and table in html and ng-repeat. it looks like this issue but the main differ is getting data from db <a href="https://stackoverflow.com/questions/30866463/angular-checklist-model-checkboxes-with-reverse-action">Angular checklist-model checkboxes with reverse action</a>
  i cannot find what i miss. any idea any help. thanks . </p>
  
  <p>The HTML</p>
  
  <pre><code>&lt;fieldset id="field3"&gt;
              &lt;table&gt;
                  &lt;tr ng-repeat="emp in empdepts | groupBy:'dep_LDesc'"&gt;
                      &lt;td&gt;
                          &lt;label ng-click="showContent = !showContent"&gt;&lt;/label&gt;
                          &lt;details ng-open="showContent"&gt;
                              &lt;summary&gt; &lt;input type="checkbox" class="test" ng-model="check_all_domains" ng-click="toggle_select_all()" /&gt; {{emp[0].dep_LDesc}}&lt;/summary&gt;
  
                              &lt;div ng-repeat="semployee in emp" class="test"&gt;
  
                                  &lt;input type="checkbox" checklist-model="objects_selected" checklist-value="semployee"&gt;
  
                                  {{semployee.Sname}}&lt;div style="display:none;"&gt;{{semployee.staffkey}}{{semployee.depkey}}&lt;/div&gt;
  
                                &lt;/div&gt;
                          &lt;/details&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/table&gt;
          &lt;/fieldset&gt;
  </code></pre>
  
  <p>The Controller</p>
  
  <pre><code>/// &lt;reference path="Scripts/angular.js" /&gt;
  </code></pre>
  
  <p>/// 
  /// </p>
  
  <pre><code>Assign.controller("AssignController", function ($scope, Assignments) {
  
  Loaddepts();
  function Loaddepts()
  {
      Assignments.getdepts().then (function(response){
  
          $scope.depts = (response.data);
          console.log($scope.depts);
      })
  
  }
  
  //$scope.employees = [];
  //$scope.checked = { employees: ['semployee'] }
  //$scope.checkAll = function () {
  //    $scope.checked.employees = angular.copy($scope.employees);
  //};
  //$scope.uncheckAll = function () {
  //    $scope.checked.employees = [];
  //};
  
  
  //$scope.emp = $scope.empdepts;
  $scope.objects_selected = [];
  $scope.check_all_domains = false;
  $scope.toggle_select_all = function () {
      $scope.objects_selected = true;
      //$scope.check_all_domains = true;
      //$scope.objects_selected = angular.copy($scope.emp);
     //angular.copy($scope.emp, $scope.objects_selected);
  };
  
  
  
  
  LoadEmpDepts();
  function LoadEmpDepts()
  {
      Assignments.getempdepts().then (function (response){
  
          $scope.empdepts = (response.data);
          console.log($scope.empdepts);
       })
  }
  
  
  $scope.selectedRow1 = null;  // initialize our variable to null
  $scope.setClickedRow1 = function (employee) {  //function that sets the value of selectedRow to current index
      $scope.selectedRow1 = employee;
  }
  
  
  
  
  
  
  $scope.save = function()
  {
  
  }
  </code></pre>
  
  <p>});</p>
  
  <p><a href="https://i.stack.imgur.com/KjA5j.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KjA5j.jpg" alt="enter image description here"></a></p>
  
  <p>}</p>
  
  <p>Thanks in advance</p>