title: Set default value for checkbox in AngularJS
body: <p>I am new to Angular JS and working on creating a table where dynamic rows can be added. The new row contains a checkbox which should default to selected (value=Y). For existing data it should show what comes up from DB (Y or N)</p>
  
  <pre><code>&lt;input type="checkbox" ng-model="safetyCheck.needed" 
          value="{{safetyCheck.needed}}" /&gt;
  </code></pre>
  
  <p>I tried adding <code>ng-checked="safetyCheck==Y"</code> and set <code>$safetyCheck:Y</code> when pushing a new blank row. But this always results in Y even if users unselects the component. how can i fix this.</p>