I'm trying to implement an autosave feature, where every 10 minutes it calls the save function. However if I use setInterval()
it throws an error, stating this.createMapXML is not a function
. But if I call the save function manually (e.g. by pressing a button) it works.
The code:
startautoSave(){setInterval(this.uploadToDataBase, 600000)};
uploadToDataBase(){
this.toUploadMap.xml = this.createMapXML();
.
.
.
}
createMapXML(): string {. . .}