After creating a new Angular App, I decided to store some data in a JSON file. My main concerns are where to best store the .json file within the app and how to access it.
Currently, I am facing this error in my Chrome console: GET http://localhost:8000/travelMap/stateData.json 404 (Not Found)
Even though this is a simple app, I want to ensure I follow best practices as I am still new to Angular/Javascript development.
I appreciate any help!
This is how my folder structure looks like: I would like to access the json in the travelMapCtrl and I've stored the json file in the same folder as this controller (travelMap) for now
Below is the JavaScript code where I am trying to access the json:
$http.get('stateData.json').then(function successCallback(response) {
console.log(response);
}, function errorCallback(response) {
console.log(response);
});