Lona
1
How do I read a JSON file that’s located in the Assets folder?
In Angular/Ionic 5 I did the following:
this.http.get(’/assets/data/somefile.json’)
I’m using Axios in order to retrieve external API, and that works fine, tried to use this here as well, but couldn’t get that to work.
This is the advised way for local assets in assets folder (angular at least). What is going wrong?
And how does that relate to axios (which I dont know)
Lona
3
I figured what I was doing wrong. I put the Assset folder in the src/ folder, instead of Public folder.
Worked better now
In regards to using Axios vs http, not sure how to use http - that’s all