Answer the question
In order to leave comments, you need to log in
How to populate an Angular select option list?
How to populate Angular select option list on click?
<div *ngFor="let order of orders"><select (click)="load(order.id)"></select></div>
load(id: number) {
this.service.load(id).subscribe((res) => {});
}
Answer the question
In order to leave comments, you need to log in
What do you have in orders?
<mat-select formControlName="Orders">
<mat-option *ngFor="let order of orders" [value]="order.id">
{{order.name}}
</mat-option>
</mat-select>
orders = [{id:1,name: "bla1"},{id:3,name: "bla2"},{id:3,name: "bla3"}]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question