I have a demo angular app that has an api/products/products.json
file for use with http.get()
. But when I made my own component and services to hit my own custom local json, it gives 404 error in Chrome console. It doesn't work even if the json file is in the same directory as the service, and consumed with http.get(numbers.json)
, it only works if I put it under the api
folder like api/numbers.json
. Does Angular have a rule where local json for http consume must exist under api
folder?
edit: found that putting the file under assets folder works, but if I create a custom folder, it doesn't work.