title: Angular ng-select - bindValue don't work and still binds to whole object
body: <p>I have a problem with ng-select (I am using newest version and Angular 10).</p>
  <p>I am creating a common component called <code>form-row-select-multiple</code>, which I will be using in many other components. Here is shortened TS file of this component:</p>
  <pre><code>  @Input() options: any[] = [];
    @Input() optionKey = 'id'; // in case of options object, specify prop
    @Input() optionKeyText = 'name'; // in case of options object, specify prop to show on option textValue
    @Input() isMultiple = true;
    @Input() selectedValues: any;
    @Output() valueChange: EventEmitter&lt;any&gt; = new EventEmitter();
    elementId: string;
  
    ngOnInit() {
      if (typeof this.selectedValues === 'object' &amp;&amp; this.selectedValues !== null &amp;&amp; this.selectedValues.length &gt; 0) {
        this.selectedValues = this.selectedValues.map(value =&gt; value[this.optionKey]);
      }
    }
  
    onChange(event: any) {
      this.valueChange.emit(event);
    }
  
    trackById(item: any) {
      return item.id;
    }
  
  </code></pre>
  <p>And HTML of this component:</p>
  <pre><code>&lt;ng-select
      [multiple]=&quot;isMultiple&quot;
      [id]=&quot;elementId&quot;
      [items]=&quot;options&quot;
      [(ngModel)]=&quot;selectedValues&quot;
      [bindLabel]=&quot;optionKeyText&quot;
      [bindValue]=&quot;optionKey&quot;
      (add)=&quot;onChange($event)&quot;
      [trackByFn]=&quot;trackById&quot;
    &gt;
  </code></pre>
  <p>As you can see in TS file, I am passing @Input() options from another component, where I am getting data asynchronously from server. My problem is, that despite of using [bindValue]=&quot;optionKey&quot; on , it stills bind its value to the whole object (when I log value of event in onChange function, it logs whole object).</p>
  <p>BindLabel works fine, so I am not sure why bindValue not. I thought that it might be because of that [(ngModel)]=&quot;selectedValues&quot; is also object, so I implemented a logic in ngOnInit, where if selectedValues are objects, I will do a simple array from that. But that did not resolve my problem.</p>
  <p>Do you please have any idea, where the problem might be? No errors showing up in the console. Thank you for all ideas.</p>