title: How can implement grouping in ng-select of Angular2?
body: <p>I am implementing multiple select dropdown in my <strong>Angular2</strong> project by following this <a href="https://plnkr.co/edit/JcG8uO9nIfSGMEKdLf0Y?p=preview" rel="nofollow noreferrer">link</a>. But now i have to show grouping in this multiple select dropdown so how can i implement this? Or is there any other plugin or something like that i can follow.</p>
  
  <p><strong>Component Html:</strong></p>
  
  <pre><code>&lt;form [formGroup]="form" class="selector-form"&gt;
      &lt;div class="marTop20"&gt;
          &lt;ng-select [options]="options1"
                     [multiple]="multiple1"
                     placeholder="Select multiple"
                     formControlName="selectMultiple"
                     (opened)="onMultipleOpened()"
                     (closed)="onMultipleClosed()"
                     (selected)="onMultipleSelected($event)"
                     (deselected)="onMultipleDeselected($event)"&gt;
          &lt;/ng-select&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>Component code in ts file:</strong></p>
  
  <pre><code>export class FilterClientSelectorComponent implements OnInit {
      form: FormGroup;
      multiple1: boolean = true;
      options1: Array&lt;any&gt; = [];
      selection: Array&lt;string&gt;;
      @ViewChild('preMultiple') preMultiple;
      logMultipleString: string = '';
  
      constructor() {
          let numOptions = 100;
          let opts = new Array(numOptions);
          for (let i = 0; i &lt; numOptions; i++) {
              opts[i] = {
                  value: i.toString(),
                  label: i.toString(),
                  groupname:'a'
              };
          }
          this.options1 = opts.slice(0);
      }
      ngOnInit() {
          this.form = new FormGroup({});
          this.form.addControl('selectMultiple', new FormControl(''));
      }
      private scrollToBottom(elem) {
          elem.scrollTop = elem.scrollHeight;
      }
  }
  </code></pre>
  
  <p>I need the output like the following screen shot:</p>
  
  <p><strong>Output Page:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/UhkM3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UhkM3.png" alt="enter image description here"></a></p>