ブール値を取得して 'checkvalue'に設定しようとしています。変数 'checkvalue'を設定するために関数isItTrueを事前に呼び出す必要があります。ボックスがチェックされていて、チェックしている場合は、doSomething()関数を呼び出す必要があります。 私は<input type="checkbox" id="{{ class.id }}" ng-init="checkBoxValue=isItTrue(class.id)"[(ngModel)]="class['checkBoxValue']"/>
で実験していましたが、うまくいきません。助言がありますか?角4 - モデルの取得と設定
<table>
<thead>
<tr>
<th>class</th>
<th>subjects</th>
<th>class speaker</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let class of classes">
<td>{{ class.name }}</td>
<td>
<div class="form">
<input type="text" class="md-input-text" placeholder=" " value=" " [(ngModel)]="subject"/>
<label class="md-desc">subjects</label>
</div>
</td>
<td>
<div class="md-checkbox">
<input type="checkbox" id="{{ class.id }}" [(ngModel)]="class['checkBoxValue']"/>
<label for="{{ class.id }}"></label>
</div>
</td>
</tr>
</tbody>
</table>
ng-initはAngularなものではありません。 – Vega