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

288
Vistas
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 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