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

267
Views
Función de llamada angular dentro de fetch (ngOninit)

Quiero llamar a una función dentro de fetch , pero por alguna razón recibo el siguiente error y no puedo encontrar una solución.

 Uncaught (in promise): TypeError: Cannot read properties of undefined (reading 'myFunction') TypeError: Cannot read properties of undefined (reading 'myFunction')

¿Cómo debo llamar a una función dentro de fetch -> entonces? Reproducción minimalista en el siguiente enlace:

https://plnkr.co/edit/kizI9pLOe8XZzKYz?preview

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Su contexto se pierde cuando declara una función.

Use la función Flecha para evitar ese error como se muestra a continuación:

 fetch('https://www.ag-grid.com/example-assets/row-data.json').then( (response) => { return response.json(); }).then( (data) =>{ this.myFunction(data); })
over 4 years ago · Santiago Trujillo 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!