Each plant has a plantid, plantname, role. I'm trying to get the entirety of the object back from the option selection.
onChange(newValue){
console.log(newValue)
this.selectedPlant = newValue
}
<select
*ngIf="plants"
class="form-control"
style="width:auto;"
#sel
[(ngModel)]="selectedPlant"
(ngModelChange)="onChange($event)"
>
<option
*ngFor="#plant of plants"
[value]="plant.plantid"
>{{plant.plantname}}</option>
</select>
If I set [value] = "plant", I get "[Object, Object]"
. I'm going to write a service to get one value from the other, but I feel like there should be a cleaner way to do this.