I am brand new to Angular 2 and I have come across the following code snippet.
<select name="shape_id" (change)="changeShape()">
<option *ngFor="let shape of shapes" [ngValue]="shape.name">
{{shape.name}}
</option>
</select>
When selecting an option from the dropdown, I would like to assign the selected shape ID to a property called shapeId in my component.
The available shapes are as follows:
[{"name":"aa","id":"1"},{"name":"bb","id":"3"},{"name":"cc","id":"2"}]
If anyone could assist me with this, it would be greatly appreciated.