title: How to checked checkbox dynamically in angularjs
body: <p>Below is the code for get all events. </p>
  
  <pre><code>var request = $http({
      method: "post",
      url: SITE_URL + '/api/getallevents',            
  }).then(function(response){ 
      angular.forEach(response.data, function(item) {
          $scope.events = item;                
      });                       
  });
  </code></pre>
  
  <p>And output is :</p>
  
  <pre><code>{"data":[
          {"event_id":"2","name":"I have a new message"},
          {"event_id":"3","name":"A meeting awaits me"},
          {"event_id":"4","name":"Someone visited my profil"},
          {"event_id":"5","name":"Someone like my profile"},
          {"event_id":"6","name":"My picture was approved"},
          {"event_id":"7","name":"My picture was rejected"},
          {"event_id":"8","name":"VIP purchase confirmation"}
      ]}
  </code></pre>
  
  <p>This is for logged in user's events</p>
  
  <pre><code>var request = $http({
      method: "post",
      url: SITE_URL + '/api/getuserevents',
      data: {  
          id:$window.sessionStorage.userid,                                   
      },
  }).then(function(response){ 
      angular.forEach(response.data, function(item) {
          $scope.events.Selected = item;           
      }); 
  });
  </code></pre>
  
  <p>And output is :</p>
  
  <pre><code>{"data":[
      {"event_id":"2","name":"I have a new message"},
      {"event_id":"3","name":"A meeting awaits me"}
  ]}
  </code></pre>
  
  <p>View file is :</p>
  
  <pre><code>&lt;label ng-repeat="event in events"&gt;
      &lt;input type="checkbox" value="{{event.event_id}}" ng-model="event.Selected" checklist-model="user.events" checklist-value="event" ng-checked="event.Selected"&gt; {{event.name}}
  &lt;/label&gt;
  </code></pre>
  
  <p>Now I want those selected data to checked among all checkbox. How is it possible.</p>