Reputation: 1006
Can someone help me fix the issue with mat-select
I would like to set the initial values using the below
orders: Order[] = [{"dish":"steak-0"},{"dish":"tacos-2"}];
Currently both are set to Tacos. Don't know how to set them using value from orders
Upvotes: 1
Views: 77
Reputation: 10790
The reason why your both selects have the same value is: name="food"
. If you name them dynamically like this they will have different initial values: name="food{{q}}"
Upvotes: 2