Object
export class Car {
ID: String;
dors: [{
number: Number,
postion: {
x: String,
y: String,
z: String,
}
}]
}
It is possible to define the value
of a select
as an object and not a simple string
. I do not mean the object to show but the value
. I tried using value={{}}
but it seems to only work with string
. I tried doing it with ngValue
, but it seems not to change the behavior. Is it possible to do it?
I want car.dors.position
as value
I tried:
<select *ngIf="car" class="form-control" #oneDoor (change)="getRecDet(oneDoor.value);" required >
<option *ngFor="let oneDoor of car.doors" [ngValue]="oneDoor">{{oneDoor.position}}</option>
</select>