title: How to automatically select check box based on the data in angularjs?
body: <p>In my webapp there are list of check boxes present. What i need is, from back-end am getting a list where data is present, based on this data i want to automatically check the checkbox. If it confusing the below is my code.</p>
  
  <p><strong>html</strong></p>
  
  <pre><code>    &lt;span ng-repeat="days in selectDays"&gt;
          &lt;input type="checkbox" id="{{days}}" ng-model="selectedList[days]" value="{{days | uppercase}}"/&gt;
          &lt;label for="{{days}}"&gt;{{days}}&lt;/label&gt;
      &lt;/span&gt;
  </code></pre>
  
  <p><strong>controller</strong></p>
  
  <pre><code>     $scope.selectDays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
  </code></pre>
  
  <p>From back end i am getting below data in response</p>
  
  <pre><code>    ["SUN", "MON"];
  </code></pre>
  
  <p>below am sharing the snapshot of my page.
  <a href="https://i.stack.imgur.com/bAc6c.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bAc6c.png" alt="enter image description here"></a></p>
  
  <p>My need is to check the response data with <code>$scope.selectDays</code> if it is present then i have to check that respective check box. i.e. if "SUN" is there in the list then i have to check that.</p>