Kris Swat
Kris Swat

Reputation: 1006

Angular Need help set value to mat-select

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

Stackblitz

Upvotes: 1

Views: 77

Answers (1)

Eldar
Eldar

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}}"

Stackblitz

Upvotes: 2

Related Questions