title: How to get checked values from checkbox using Angular JS
body: <p>Am new to angular JS. I have following check box and the data is coming from web service:</p>
  
  <pre><code> &lt;label ng-repeat="r  in MedicalConditions track by $index"&gt;
      &lt;input ng-model="ids[$index]" type="checkbox" ng-checked="r.value"&gt; 
         {{r.conditions_name}}
      &lt;/label&gt;
  </code></pre>
  
  <p>In console.log value is perfectly right as per my requirements. How to push value to an array i.e., arr[] and stringify it. I tried code like this..</p>
  
  <p>//To fetch Medical Conditions List</p>
  
  <pre><code>$scope.parameter = "{}";
  $scope.class0 = "{}";
  $http.get('http://192.168.1.129:8080/apartment//member/medical/conditions/list').then(function(response) {
      $scope.MedicalConditions = response.data.list;
  });
  
    $scope.$watchCollection('ids', function(newVal) {     
         $scope.parameter.class0 = $scope.ids;
      }); 
  
  
  $scope.alertdata = function() {
      var parameter = {
          "first_name": $scope.first_name,
  
          "role": [{
              "role_id": 1,
              "name": "Admin",
              "details": "text"
          }],
          "associated": [{
              "associated_id": 1,
              "associated_name": "Parent",
              "primary_member_id": 1
          }],
          "class0": $scope.ids
      }
      parameter = JSON.stringify(parameter);
  </code></pre>