I need to pass object to the function when I change option in select.
<select (change)="addToVisibility('type',$event.target.value)">
<option *ngFor="let type of selectedTypes" [ngValue]="type">
{{type.title}}
</option>
</select>
I try like this, but always in function pass type.title, but i need to pass type. Please help me) P.S. Sorry for my bad English
You can use ngModel with ngModelChange as follows
<select [(ngModel)] ="selectedType" (ngModelChange)="addToVisibility(selectedType,$event.target.value)">
<option *ngFor="let type of selectedTypes" [ngValue]="type">
{{type.title}}
</option>
</select>
<select [(ngModel)] ="selectedType" (ngModelChange)="onSelectChange($event,selectedType)">
<option>Slect Light Dimmer</option>
<option [ngValue]="leddim" *ngFor="let leddim of dimmerlightlist">{{leddim.NODE_NAME}} </option>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With