title: Add student absence to an array of Students absence Ids
body: <p>I am trying to add student absent in an array that contain the id of each student 
  where studentsList in the code is array of Students and Student has an attribute called isAbsence if its =true then the student if must be added to the array of ids else it will not e added 
  The problem is :<br>
  it seems that array of ids is always empty even if I check the student box ! so no student absence added !!!</p>
  
  <p><strong>here is the html</strong></p>
  
  <pre><code>&lt;form name="absenceForm"  novalidate&gt;
  
      &lt;table id="studentListTable" border="1"&gt;
          &lt;thead&gt;
              &lt;tr&gt;
                  &lt;th&gt;Absent?&lt;/th&gt;
                  &lt;th&gt;Student ID&lt;/th&gt;
                  &lt;th&gt;Student Name&lt;/th&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
  
              &lt;tr ng-repeat="student in studentsList"&gt;
                  &lt;td&gt;&lt;input type="checkbox" ng-model="student.isAbsenct"               
                    value="student.isAbsent" ng-class="student.isAbsent ? 'checked' : ' '"&gt;&lt;/td&gt;
                  &lt;td&gt;{{student.id}}&lt;/td&gt;
                  &lt;td&gt;{{student.firstName}} {{student.lastName}}&lt;/td&gt;
              &lt;/tr&gt;
  
          &lt;/tbody&gt;
      &lt;/table&gt;
      &lt;br&gt; &lt;input type="submit" value="Submit" ng-click="addAbsence()"/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>and in the controller.js</strong></p>
  
  <pre><code> $scope.addAbsence = function() {
  con
          $scope.absentStudentIds = [];
          for (var i = 0; i &lt; $scope.studentsList.length; i++)
          {
              if ($scope.studentsList[i].isAbsent === true)
              {
                  $scope.absentStudentIds.push($scope.studentsList[i].id);
                  console.log($scope.absentStudentIds);
              }
          }
          var requestParameters = {
              crn: $scope.selectedCrn,
              absenceDate: $scope.selectedAbsenceDate,
              absentStudentIds : $scope.absentStudentIds
  
          };
  
          $http.post('http://localhost:8080/amsjs/rs/users/absence', requestParameters)
                  .success(function(response) {
                      console.log(response);
                      $scope.$parent.alertMessage = response;
  
                  })
                  .error(function(response, status, headers, config) {
                      $scope.$parent.alertMessage = response;
                      console.log(response, status, config);
  
                  });
      };
  </code></pre>
  
  <p><br>
  <strong>Thanks in advance</strong> <br></p>