So I'm designing a program that lets a user send a JSON to an API using HTTP-Post.
The Json are stored in a folder inside my application called JsonFiles
then inside this folder are then put into there own brand name so the path looks something like this >JsonFiles>Nike>OrderConfirm.Json
What would be a good way to let the user select a JSON File from the user interface in like a dropdown menu?
What I have so far is being able to pick a specific file from the component.ts using import, but this is no good due to I need user interaction to choose the file. In case anyone is wondering I'm creating an application for work. Thanks guys so much.
You can move these json files to the assets folder. So it will be available to fetch using http request.
And in the component you just need to keep the file names.
You can also just keep your folder anywhere, But add that path to angular.json as follows,
For ref: https://github.com/angular/angular-cli/wiki/stories-asset-configuration