Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

277
Views
¿Por qué mi interfaz de usuario se congela hasta que finaliza la llamada a la API?

Tengo una llamada a la API que descarga todos los municipios italianos, que son casi 8000. El problema es que la página carga el HTML, pero no puedo hacer clic en nada hasta que termina la llamada a la API.

 ngAfterViewInit(){ this.loadComuni(); } loadComuni(){ //Italian municipalities this.RegisterService.getMunicipalities().subscribe( obj=>{ this.city=obj; }, error=>{ console.log("error", error); }); } <div class="col-12 col-lg-4""> <select id="cbComNasc" class="form-control" formControlName="cbComNasc"> <option *ngFor="let c of city" [ngValue]="c.citta">{{c.citta}}</option> </select> </div> //getMunicipalities public getMunicipalities():Observable<Comuni[]>{ const httpOptions = { headers: new HttpHeaders({ "Content-Type": "application/json; charset=UTF-8", 'Accept': 'application/json' }) }; return this.HttpClient.get<Comuni[]>(environment.apiURL+"api/v1/gestionale/GetComuni",httpOptions) }

También probé con la tubería asíncrona o con la promesa pero el problema es el mismo.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Yo también tuve el mismo problema . Si tiene una gran cantidad de datos, ngFor tardará un tiempo en procesarlos, así que tenga una matriz separada y procese de 10 a 20 registros inicialmente y si el usuario se desplaza hacia abajo, procese 10 t0 más o tenga una función de paginación.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!