Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

354
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda