I am attempting to retrieve the ID of a list item in a select menu but I am having trouble getting the value from it. The value should be a number. HTML File
<div class="form-group mt-3">
<label class="form-label">Product Category</label>
<select class="form-control" #categoryId>
<option *ngFor="let cat of categories" value="{{ cat.catId }}">
{{ cat.catName }}
</option>
</select>
</div>
<div class="form-group mt-3">
<button
class="btn btn-success"
(click)="
saveProduct(productName.value, productPrice.value, categoryId.target.value)
"
>
Save
</button>
</div>
TS File
saveProduct(name: string, price: string, id: number) {
var newProduct: Product = new Product();
newProduct.productId = Math.floor(Math.random() * 100);
newProduct.productName = name;
newProduct.productCatId = id;
}