Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 复选框状态仅在下次请求时可用_Angular - Fatal编程技术网

Angular 复选框状态仅在下次请求时可用

Angular 复选框状态仅在下次请求时可用,angular,Angular,我有这个模板: <h2>Sailing profiles</h2> <label *ngFor="let sailingProfile of sailingProfiles"> <input type="checkbox" name="{{sailingProfile.title}}" [(ngModel)]='sailingProfile.checkBoxState' (change)="sendParams()"> {{sail

我有这个模板:

<h2>Sailing profiles</h2>
<label *ngFor="let sailingProfile of sailingProfiles">
    <input type="checkbox" name="{{sailingProfile.title}}" [(ngModel)]='sailingProfile.checkBoxState' (change)="sendParams()">
    {{sailingProfile.title}}<br>
</label>
<h2>Counters</h2>
<label *ngFor=" let counter of counters">
    {{counter.type}}: <input type="text" [(ngModel)]='counter.value' (blur)="sendParams()"><br>
</label>
(更改)
(单击)
事件在
(ngModelChange)
事件之前处理

改用

<input type="checkbox" name="{{sailingProfile.title}}" 
    [(ngModel)]='sailingProfile.checkBoxState' 
    (ngModelChange)="sendParams()">

您使用的Angular2版本是什么?@angular/core:“2.0.0-rc.4”我也尝试过(单击)=“sendParams()”,但结果相同
<input type="checkbox" name="{{sailingProfile.title}}" 
    [(ngModel)]='sailingProfile.checkBoxState' 
    (ngModelChange)="sendParams()">