如何在angular2中选择不同条件下的checbox

时间:2017-01-13 04:27:02

标签: angular

enter image description here

   <tr *ngFor="let item of  _studentList">
    <td  align='center'>{{item.rollno}}</td>
    <td  align='center'>{{item.sname}}</td>      
    <td  align='center'>
        <input type='checkbox' style='height:15px; width:15px;' ng-checked="item.status=='P'" ></td>

如果学生Present checbox checked Absent unchecked那么CloudFile.UploadFromStream(...)我上面尝试了但是没有工作

怎么做?

1 个答案:

答案 0 :(得分:6)

ng-checked用于角度1而非角度2。 尝试

  <input type='checkbox' style='height:15px; width:15px;' [checked]="item.status=='P'" >