title: How to mark check box as a checked in angular 4
body: <p>I am very new in angular 2. i need to mark check box on a button click.
  i have some checkbox in a loop like </p>
  
  <pre><code> &lt;tr *ngFor="let roleObj of roleNameList"&gt;
        &lt;td&gt;
           &lt;input type="checkbox"   id ={{roleObj.roleID}} /&gt;
       &lt;/td&gt;
       &lt;td&gt;{{roleObj.roleName}}&lt;/td&gt;
    &lt;/tr&gt;
  </code></pre>
  
  <p>i have one array of selected role, only i need to mark those check boxes on a edit button click . so what i did like same in javascript</p>
  
  <pre><code> document.getElementById("role").checked
  </code></pre>
  
  <p>but in angular 4 there is no property like that.</p>
  
  <p>i searched and found there is one property binding for </p>
  
  <blockquote>
    <p>[checked] ="somevariable"</p>
  </blockquote>
  
  <p>but the problem is same property [checked] ="somevariable" will add on all checkboxes. the result is when i assigned the somevariable as true. it will mark all the checkboxes.</p>
  
  <p>other solution I have in jquery like </p>
  
  <pre><code>$(document.getElementById(role)).prop('checked', true);
  </code></pre>
  
  <p>but might be it can create problem, i am not sure please correct me.</p>
  
  <p>please help me. any clue or logic will same my days.</p>