mercredi 20 avril 2016

How to uncheck a checkbox in angular2

I have code in the HTML file that looks like this

 <tr *ngFor="#tradeSource of tradeSources">
     <td>
         <label>
         <input type="checkbox" ngControl="tradeSource"    [(ngModel)]="tradeSource['checked']"/>
         </label>
     </td>           
     <td></td>
     <td></td>
     <td></td>
</tr>

A user can check the check box then click a "Process" button that will run some code, after this code has run I would like to uncheck this checkbox. Ive tried code like

this.tradeSource[i]['checked'] = false

But this isnt working




Aucun commentaire:

Enregistrer un commentaire