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