1

I am using Select with multiple selection component.

enter image description here

I want to make 2 items to be selected by default like this.

enter image description here

I have surfed,but i got resources only for Basic select component, How can i achieve this?

Empty_Soul
  • 799
  • 2
  • 13
  • 31
  • Can you edit in this stackblitz link? https://stackblitz.com/angular/xamkeymbbvvk?file=app%2Fselect-multiple-example.ts – Empty_Soul Oct 10 '18 at 09:29

1 Answers1

3

I have done it here please check 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);
  }
}
Vivek Kumar
  • 4,822
  • 8
  • 51
  • 85