I am currently working on an Ionic Application and my goal is to store data in a JSON file.
For creating the file, I execute the following code snippet:
this.file.writeFile(this.file.dataDirectory, 'test.json', 'hello,world,', {replace: true});
Unfortunately, the above code doesn't seem to be working as expected. The test.json file is not being created!
What could possibly be causing this issue?
EDIT: I recently received advice that I might need to incorporate cordova into my project. Can anyone elaborate on what that entails?
EDIT: Could it be because I am unable to locate "this.file.dataDirectory"?
PS: I have been executing (ionic cordova run browser) to run my script. Is there a chance that this method is causing complications?
In addition, even after implementing Melchia's suggestion, I am still not seeing any output in the console.log!