title: How to set default value checked in a checkbox from database using AngularJS
body: <p>While editing the record the data comes in their respective fields for editing, but the checkbox is not checked if its value is <code>1</code>.</p>
  
  <p>It should be in checked state if it has <code>1</code> and not checked if it has <code>0</code> as the datatype of the field is <code>tinyint</code>. I am retrieving the data from JSON array via PHP. I am trying to get value by <code>ng-checked="{{rec.isSpecial}}"</code> but it is not working.</p>
  
  <p>Here is my HTML:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="form-group"&gt;
    &lt;div class="col-lg-offset-2 col-lg-10"&gt;
      &lt;div class="checkbox c-checkbox"&gt;
        &lt;label&gt;
          &lt;input type="checkbox" ng-checked="{{rec.isSpecial}}" ng-model="rec.isSpecial"&gt;
          &lt;span class="fa fa-check"&gt;&lt;/span&gt;Special
        &lt;/label&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>here is my JS</p>
  
  <pre><code>$scope.rec = $resource('api/AdminArea/category/edit/:id', {
    id: id
  }).get(function(data) {
    $scope.rec = data;
  });
  </code></pre>