Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

352
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda