Hi there!
Im trying to load a JSON file locally from a provider.
I have tried using this answer and this answer.
Neither worked.
I have the JSON file located in app/data/questions.json. I run ionic serve and the gulp task does not serve any errors, and the console does not output errors in console. However when I view the sources in dev tools, I cant see the file.
I have tried refencing several different paths for the source and destination, but it makes no difference.
This problem I assume would also appear if I tried to load photos as well.
Any methods that have worked for you?
Thanks for any help.
And I can provide code in comments if needed.
EDIT: I feel like an idiot. The file was loading, but I could not see it in the sources. However, when I added a console.log(.json file) it showed up. I figured there was something wrong because there was no content. There was no content, though, because the JSON files content had been changed.
Solution: use console.log to see if your json file is loading. If it is, then make sure your display is working properly.