I am trying to load a java script file in to a component. If the file is copied outside the 'src' folder it is working fine, but inside 'src' folder it is getting 404 error. I tried with different scenarios but issue not resolved.

Thanks
Vimal
I think Angular will consider those as static files, meaning that they won't load on compile time, but rather at runtime, and at runtime there will be on /src but instead only assets (or what you ask Angular to copy over from src.
You have 2 options here:
1- Moving your static files into asstes and then you can reference them as /assets/payment/js/init-payment.js.
2- Ask Angular to copy certain directory from src into build directory when compiling.
and that's done in angular.json file inside the assets array.
For more details see this answer here: