I added the checkbox in each row of table and each row having angular2 select also.I checked the first and second row.Then I select from first row's angular2 select.I want the selected option of first row should updated to all checked row angular2 select.But it is not updating the select checked row angular2 select.
I checked two rows and select "kray" value of first ng-select but it is not updating the second row ng-select.The second ng-selct selected value should be "kray"
Please help me.
Here is my code
<tbody class="set-font">
<tr [class.info]="tr.status"
*ngFor="let tr of activeTabData let i = index" class="tros-auditors">
<td scope="row">
<input type="checkbox" value={{tr.id}}
class="checkedauditors"
id={{tr.checkboxId}}
(click)="toggleCheck(tr,i)"
[(ngModel)]="tr.status"
></td>
<td>{{tr.clientCode}}</td>
<td>{{tr.carrierCode}}</td>
<td><div><my-date-picker [options]="myDatePickerOptions" id={{i}}
(dateChanged)="onDateChanged($event)"
[selDate]="selectedDate"
>
</my-date-picker>
</div>
</td>
<td [formGroup]="form">
<ng-select id={{i}}
[options]="optss"
placeholder="{{tr.assignee}}"
formControlName="selectSingle"
(opened)="onSingleOpened1(i)"
(closed)="onSingleClosed1()"
(selected)="onSingleSelectedManager1($event,i)"
[(ngModel)]="hideSelectedAuditor"
(deselected)="onSingleDeselected($event)">
</ng-select>
</td>
</tr>
</tbody>
The JSON
{
[{
"clientCode": "NIKE",
"carrierCode": "FDE",
"auditDeadlineDate": "11/11/2016",
"assignee": "Flansdon",
}, {
"clientCode": "NIKE",
"carrierCode": "FDE",
"auditDeadlineDate": "05/29/2017",
"assignee": "Flansdon"
},{
"clientCode": "NIKE",
"carrierCode": "FDE",
"auditDeadlineDate": "06/01/2017",
"assignee": "Flansdon"
}],
}
mydata.ts file below
onSingleSelectedManager1(item,index) {
console.log("This is Index",index);
for(let i=0;i<this.checkedArray.length;i++){
this.checkedArray[i].assignee = item.label;
}
}