I am creating an Ionic Application and I need to save data in a JSON file.
To create that file, I run:
this.file.writeFile(this.file.dataDirectory, 'test.json', 'hello,world,', {replace: true});
But the code above doesn't do anything. test.json doesn't get created!
What is the Issue?
EDIT: Someone told me I must use cordova. Is that true? If so, what does he mean?
EDIT: Is it because i can't file "this.file.dataDirectory"?
PS: I am using (ionic cordova run browser) to run the script. Would that cause problems.
Also, After using Melchia's example, I don't even get a console.log!