Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

343
Views
ng-select doesn't display value in ngModel
<ng-select [items]="items$ | async"
            bindLabel="value"
            minTermLength="2"
            bindValue="id"
            [(ngModel)]="val"
            [typeahead]="valInput$">
</ng-select>

ng-select above does server-side search and until typing something that items is empty but the variable val is not. Need to see val's value as selected item but can't achieve that so my guess is the reason for that is items being empty.

Is there a way to display val in that ng-select component even if items is empty?

UPDATE: I've populated items$ with existing values. But still can't make them selected.

UPDATE 2: I've found the solution, bindValue="id" was the problem and I needed to remove it which means binding the whole object instead of it's id attribute to selected item.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!