简体   繁体   English

Angular 6 td 标签中的复选框不触发(更改)

[英]Angular 6 Checkbox in td tag doesn't fire (change)

I am working on a angular project where I wish to check on the dynamic generated checkbox which are being checked however the (change) handler doesn't seems to fire我正在开发一个 angular 项目,我希望在其中检查正在检查的动态生成的复选框,但是(更改)处理程序似乎没有触发

tickets.html门票.html

<tr *ngFor="let ticket of tickets; let i = index">
<td *ngIf="memberView">
<div class="custom-checkbox">
   <input type="checkbox" (change)="memberChange($event,ticket)" id="memberEvent{{i}}" class="custom-control-input -input-check" value="">
</td>
</tr>

tickets.ts门票.ts

memberChange(event,ticket){
    console.log('onchange',ticket);
}

however the logging doesn't seems to fire at all, could someone help me with it但是日志似乎根本没有触发,有人可以帮我吗

Attribute value of the checkbox is not binded with any value复选框的属性值未绑定任何值

<tr *ngFor="let ticket of tickets; let i = index">
  <td *ngIf="memberView">
  <div class="custom-checkbox">
    <input type="checkbox" (change)="memberChange($event,ticket)" id="memberEvent{{i}}" class="custom-control-input -input-check" [value]="ticket">
  </div>
  </td>
</tr>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM