Nebular: NbSelect missing compareWith input similar to the native select

Created on 24 Jul 2019  路  4Comments  路  Source: akveo/nebular

Issue type

I'm submitting a ... (check one with "x")

  • [ ] bug report
  • [x] feature request

Issue description

Current behavior:
I had form thats' loads data from an API, binding an object to NbSelect (selcted) not working for object value

Expected behavior:
something similar to compareWith Input specified on the https://angular.io/api/forms/SelectControlValueAccessor

Steps to reproduce:

Related code:

myComponent.html

<nb-select formControlName="user" [selected]="form.value.user [compareWith]="compareById">
    <nb-option *ngFor="let usert of users" [value]="user">
        {{ user.fullName }}
    </nb-option>
</nb-select>

myComponent.ts

  users = [{id: 1, fullName: 'Foo"}, {id: 2, fullName: 'Bar'}]
  compareById(user1: User, user2: User) {
    return user1 && user2 && user1.id === user2.id;
  }

Other information:

npm, node, OS, Browser

node: v10.15.3
npm: 6.4.1
OS: macOS (Mojave)
Browser: Opera Chromium
-->

Angular, Nebular

Angular: 8.0.0
Nebular: 4.1.2
nice to have enhancement help wanted components needs triage

Most helpful comment

I need this.

All 4 comments

Some update about it?

Any update?

I need this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

batousik picture batousik  路  4Comments

aqsdc1 picture aqsdc1  路  3Comments

bnbs picture bnbs  路  4Comments

muysewinkel picture muysewinkel  路  4Comments

dragonbane0 picture dragonbane0  路  3Comments