- I want to enable selecting values in a MatSelect component
- The MatSelect should contain a list of Objects from Tax, obtained after sending a Get Request to the API
- The Tax Object contains an Id and Percentage variables
The Problem is how do I populate MatSelect, below is the code I tried
I couldn't find examples
<MatSelect Label="Tax" @bind-Value="ProductData.TaxId">
@foreach (var item in taxItems)
{
<MatOption Value="@item.Id">@item.Percentage</MatOption>
}
</MatSelect>
public class Tax
{
public int Id { get; set; }
public double Percentage { get; set; }
}