I have some data that i am showing using ngFor directive in a table. I have checkbox in the last column and i want it to select only the row that will be selected but not the other rows. Here is my code
HTML Code
<div *ngIf="!admin">
<div class="row clearfix">
<div class="col-sm-12">
<input type="checkbox" name="permission12" value="" (change)="isSelected = !isSelected" class="filled-in" id="permission12" (click)="chosen(listSupportAdminSchools.items)" />
<label for="permission12">: Select All</label>
<table class="table-bordered table-striped" style="width:100%">
<thead>
<tr>
<th>Name</th>
<th>Registration Number</th>
<th>Enrollment Type</th>
<th>Entity Type</th>
<th>Location</th>
<th>IsActive</th>
<th>Select</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let x of listSupportAdminSchools.items;">
<td>{{x.name}}</td>
<td>{{x.registrationNumber}}</td>
<td>{{x.educationType}}</td>
<td>{{x.administrativeType}}</td>
<td>{{x.county}}
<span>,</span>{{x.city}}
<span>,</span>{{x.district}}</td>
<td></td>
<td style="text-align: center">
<!-- <button (click)="onClick()" class="btn btn-primary waves-effect">Select</button> -->
<input type="checkbox" name="permission13" value="" [(ngModel)] = "isSelected" class="validate form-control" id="permission13" (click)="chosen()" />
<label for="permission13">: Select</label>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
while in my .ts file i have a isSelected boolean variable set to false.
Whenever i click on one checkbox in the row it select other one too. But the select all checkbox is working just fine