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

107
Views
Api information is not shown in the browser Angular

enter image description here The api information is showing in the console but not in the browser. Before I asked and one user said that I have to put

*ngIf = "catServ.length"

and then

*ngFor = "let item of catServ"

as you can see it here

<div *ngIf="catServ.length">
    <h2 *ngFor="let item of catServ" class="text-3xl md:text-4xl font-extrabold tracking-tight leading-7 sm:leading-10 truncate" style="font-size: 20px!important;">
        {{item.nombre}}
    </h2>
</div>

But the console shows an error that did not recognize that.

this is my ts file to call the api from the server

this.http.get(this.apiserver.apiUrl + 'negocios/listadoTodos/?negocioCategorias=1').subscribe(deCat => {
      this.catServ = deCat;
    });

What can I do in this case? I want to see the information in the browser, and now is only showing in the console

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

0

Your questing does not clarify what you are actually trying to achieve.

Are you trying to get rid of the error? Do you want to see the data in the browser window?

I am going to assume you want to get rid of the error first

Add *ngIf="catServ && catServ.length" to avoid getting the error before catServ is initialized.

You can check the network tab to see the requests and check if you are getting any data back from the server

<div *ngIf="catServ && catServ.length">
    <h2 *ngFor="let item of catServ" class="text-3xl md:text-4xl font-extrabold tracking-tight leading-7 sm:leading-10 truncate" style="font-size: 20px!important;">
        {{item.nombre}}
    </h2>
</div>
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!