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

107
Visualizações
ng-select search function not showing any result

I am using angular cli version - 11.2.8 and using the ng-select version of 7.3. Currently, I am able to render the UI as expected but when I tried to search in the input box inside the select element, it didn't search anything. I look for the issue in the package detail of NPM itself then have a list of versions which are compatible with different kinds of angular CLI version. Looks like I am using the correct version, still ng-select not working as properly.

<ng-select [(ngModel)]="selectedCars">
   <ng-option *ngFor="let car of cars" [value]="car.id">{{car.name}}</ng-option>
</ng-select>

 selectedCars = 3; //i also used selectedCars =[3], and selectedCars ="3", but it didn't work
  cars = [
    { id: 1, name: 'Volvo' },
    { id: 2, name: 'Saab'},
    { id: 3, name: 'Opel' },
    { id: 4, name: 'Audi' },
];

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

please try below code hope it will solve your problem

<ng-select [items]="cars" bindLabel="name" bindValue="id [(ngModel)]="selectedCars"> </ng-select>

for more detail please check the example https://stackblitz.com/run?file=src%2Fdata-source-array-example.component.html

about 4 years ago · Juan Pablo Isaza Relatório
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