Angular 6 Material <mat-select> valor predeterminado de conjunto múltiple usando control de formulario
Estoy usando el control de formulario aquí hay código para mi componente html
<mat-form-field>
<mat-select placeholder="Toppings" [formControl]="toppings" multiple>
<mat-option *ngFor="let topping of toppingList" [value]="topping">{{topping.value}}</mat-option>
</mat-select>
</mat-form-field>
Y mi archivo ts es
export class SelectMultipleExample {
toppings = new FormControl();
toppingList: any[] = [
{ id:1,value:"test 1"},
{ id:2,value:"test 2"},
{ id:3,value:"test 4"},
{ id:4,value:"test 5"},
{ id:5,value:"test 6"},
{ id:6,value:"test 7"}
];
constructor(){
this.bindData();
}
bindData(){
const anotherList:any[]=[
{ id:1,value:"test 1"},
{ id:2,value:"test 2"}
]
this.toppings.setValue(anotherList)
}
}
Quiero establecer el valor predeterminado para la selección del tapete, cualquier ayuda para lograrlo será excelente. Quiero establecer un valor predeterminado múltiple.