title: ng-select: how to select multiple items having same label but different object
body: <p>I'm trying to patch multiple selected items in ng-select drop down. I have not specified any bindValue, so the items should be bind by object (as specified at <a href="https://www.npmjs.com/package/@ng-select/ng-select" rel="nofollow noreferrer">https://www.npmjs.com/package/@ng-select/ng-select</a>)</p>
  
  <p>But while trying to do this the items do not get selected depending on the object but by the label displayed. Also only the first label gets selected.</p>
  
  <p>Example: app.component.html</p>
  
  <pre><code>&lt;form [formGroup]="group"&gt;
      &lt;div class="form-group" formGroupName="school"&gt;
          &lt;ng-select labelForId="school" placeholder="Select school" [items]="schools" formControlName="code"
              bindLabel="displayLabel" multiple="true" groupBy="city"&gt;
          &lt;/ng-select&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>app.component.ts</p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { FormBuilder, FormGroup, FormControl, Validators } from '@angular/forms';
  
  @Component({
    selector: 'my-app',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.css']
  })
  export class AppComponent implements OnInit {
    group: FormGroup;
    schools = [];
    constructor(private fb: FormBuilder) { }
  
    ngOnInit() {
      this.initSchools();
      const formModel = {
        school: new FormGroup({
          code: new FormControl(null, Validators.required)
        })
      }
      this.group = this.fb.group(formModel);
      this.group.patchValue({
        school: {
          code:
            [
              {
                schoolId: 'SC003',
                displayLabel: 'Test-3 school',
                city: "City1"
              },
              {
                schoolId: 'SC005',
                displayLabel: 'Test-3 school',
                city: "City5"
              }
            ]
        }
      });
    }
  
    initSchools() {
      this.schools.push(
        {
          schoolId: 'SC001',
          displayLabel: 'Test-1 school',
          city: "City1"
        },
        {
          schoolId: 'SC002',
          displayLabel: 'Test-2 school',
          city: "City2"
        },
        {
          schoolId: 'SC003',
          displayLabel: 'Test-3 school',
          city: "City3"
        },
        {
          schoolId: 'SC004',
          displayLabel: 'Test-4 school',
          city: "City4"
        },
        {
          schoolId: 'SC005',
          displayLabel: 'Test-3 school',
          city: "City5"
        }
      );
    }
  }
  </code></pre>
  
  <p>In the example above only the object for item</p>
  
  <pre><code>    {
        schoolId: 'SC003',
        displayLabel: 'Test-3 school',
        city: "City1"
      },
  </code></pre>
  
  <p>gets selected, </p>
  
  <p>and the below item does not</p>
  
  <pre><code>    {
        schoolId: 'SC005',
        displayLabel: 'Test-3 school',
        city: "City5"
      }
  </code></pre>
  
  <p>What should be the way so both the items gets selected in drop down (with provide unique objects).
  Is any thing missing out here. Any other way to achieve this.</p>
  
  <p>Have example running here : <a href="https://stackblitz.com/edit/angular-szel64?file=src%2Fapp%2Fapp.component.ts" rel="nofollow noreferrer">https://stackblitz.com/edit/angular-szel64?file=src%2Fapp%2Fapp.component.ts</a></p>