I encountered an Error message:
{"__zone_symbol_currentTask":{"type":"microTask","state":"notScheduled","source":"Promise.then","zone":"angular","cancelFn":null,"runCount":0}}
Here is the corresponding code snippet:
async getNewData(id: number, path: string, howMany: number) {
let fileManagement: FileManagement = new FileManagement();
let result: any = null;
switch (id) {
case 0:
alert("pfad: " + path);
await fileManagement.readFile(path + "Tasks/", "task_" + howMany + ".tsk").then((text) => {
alert("text: " + text);
result = JSON.parse(text);
alert("completed");
}).catch((error)=>{
alert("error encountered: " + JSON.stringify(error));
});
default:
result = JSON.parse(this.getDataFromComponent(id, howMany, path));
//code to call components for generation
}
return result;
}
constructor(public navCtrl: NavController, private tts: TextToSpeech, navParams: NavParams) {
this.path = navParams.get('path'); //PASS EXERCISE FOLDER PATH HERE
this.newData.getNewData(0, this.path, this.fileCounter).then((data) => {
this.buffer = data;
this.fileCounter++;
this.nextChoice(0);
}).catch((error) => {
alert(JSON.stringify(error)); //error handling here
});
}
Can anyone explain why this error is occurring and suggest a solution? Appreciate any guidance!