Please do not mark this as a duplicate since I have not found a solution yet. Any help would be appreciated.
I have a file called category.json
located next to my index.html
file, containing the following JSON data:
[{"name":"veg"},{"name","non-veg"}]
When running locally, I am able to retrieve this data using both $resource and $http without any issues.
However, upon hosting it on a server, I encounter a file not found 404 error
.
Even though we can achieve this by directly declaring it with var
or $scope
, I specifically need to work with the local json file only.