we are using NG-SELECT trying a create multiple forms with drop-down , we are trying to update the value of all dropdowns when one of the dropdown is updated but unable to find the correct node or configuration option to set it.
//reusable-form.component.ts
.. some inputs here
<ng-select
[searchable]="false"
[clearable]="false"
[(ngModel)]="selectedOption"
placeholder="search"
(change)="onSelect($event)"
>
<ng-option *ngFor="let data of datas; trackBy:userByName" [value]="data.name">{{
data.name
}}</ng-option>
</ng-select>
we tried setting the option on change event as below, but the values are updated on rest of the drop-downs
onSelect(event){
this.selectedOption = event ; // even though model already has the value in it
this.cdref.detectchanges();
}
New contributor
Hari is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.