Check out this block of code
httpcsv2Array(event) {
var gethttpcsv =
Papa.parse('https://docs.google.com/spreadsheets/d/e/yadyada/pub?output=csv', {
download: true,
header: true,
dynamicTyping: true//,
complete: this.importhttpcsv
});
}
importhttpcsv(results) {
this.bformservice.deleteAll();
results.data.forEach(item => {
let tarr = item as bform;
this.bformservice.bulkcreatebform(tarr);
});
}
While working with the above code, I encountered an error message stating that importhttpcsv is being called within the papa.parse context which leads to the following error: TypeError: Cannot read property 'deleteAll' of undefined
Interestingly, in other methods within the same class, using this.bformservice.deleteAll() does not raise errors.
In order to update the database, I require access to functions from a separate service. Could you suggest a solution for this issue?
Your assistance is greatly appreciated!