答案 0 :(得分:1)
我已经在这里完成了,请检查https://stackblitz.com/edit/angular-zs2wa5?file=app/select-multiple-example.ts
export class SelectMultipleExample {
toppings;
toppingList: string[];
constructor() {
this.toppings = new FormControl();
this.toppingList= ['Extra cheese', 'Mushroom', 'Onion', 'Pepperoni', 'Sausage', 'Tomato'];
this.toppings.value = ['Mushroom', 'Onion', ];
console.log(this.toppings);
}
}