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

287
Visualizações
Limit results in a datalist to improve page loading time Angular

I have a form I am working on with Angular JS. This form has multiple dropdown fields and input fields that search through datalists. These datalists and dropdown fields are being populated with data from some api's. One of the datalists is calling an api which returns ~40,000 records, so when opening up this form, this datalist with all those records causes the page to take a while to fully load. (Can't start filling out the form until everything is loaded)

Is there any way I could limit the results this datalist displays to improve loading time but still have all the records available for a user to search through?

HTML:

<div>
   <mat-form-field floatLabel="auto" class="frame-mat-input required">
      <mat-label style="font-size: 14px;">PRIMARY CLIENT</mat-label>
      <input matInput type="text" list="client" (change)="saveCode3($event)">
      <datalist id="client">
         <option *ngFor="let pc of primClient" [value]="pc">{{pc}}</option>
      </datalist>
   </mat-form-field>
</div>

Typescript:

//Call to get clients returns 40,000+ records
  getClients() {
    this.httpClient.get<any>('http://localhost:3000/client').subscribe(
      response => {
        // console.log(response[0])
        for (let i = 0; i < response.length; i++) {
          if (response[i].Country == 'CA' && response[i].Status == 'A') {
            this.primClient.push(response[i].Name)
          }
        }
      }
    )
  }
primClient: any = [];
//Filters through datalist based on user input. Way to limit results here to improve efficiency?
public saveCode3(e: any): void {
let find = this.primClient.find((x: { name: any; }) => x?.name === e.target.value);
}
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