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

252
Vistas
How invoke class method into the async method function

I have one error, When I invoke the handleRenderPage method to the async method i got error : model.js:83 Uncaught (in promise) TypeError: this.handleRenderPage is not a function

I use MVC to write todo project and in the model class I send the todo list array with handleRenderPage method and I use downloadTask to got the todo list from the server and send it to the view class this is async function:

  downloadTask = async() => {
    const url = 'http://localhost:9090/download';
    const res = await fetch(url);
    const data = await res.json();
    this.tasksList = data;
    console.log(this.tasksList);
    //down is the method 
    this.handleRenderPage(this.tasksList);
  }

and I invoked this func outside the class :

downloadBtn.addEventListener('click', () => {  
  const model = new Model();
  model.downloadTask();
})

when user click download btn app should render todo list from the server

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

beacause this.tasklist is undefined and you should invoked it in View and then controler get information in model and send it to Model module

about 4 years ago · Juan Pablo Isaza Denunciar
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