0

I have my config file at location /etc/project/project.config

How can I access this file in my project ? With every build this file changes (so no use of saving statically in project) and I need to access some contents from it.

I have referred and tried this - Angular 2 / Angular 4 : How can i access file from the local system location?

but this is not working. Can you please help to get this file?

Nils
  • 45
  • 1
  • 3
  • 9
  • What kind of web server do you use to serve your data? Static files serving is usually done by server. – mutantkeyboard May 29 '18 at 11:50
  • it's fully configured web server for live project – Nils May 29 '18 at 11:55
  • You didn't get me. Is it a PHP server, Ruby server, Node.js server, or something else? Angular itself is just a frontend framework, which means that it usually doesn't need to do too much reading and writing on the filesystem. If you really want to do it the Angular way, I'd refer you [here](https://blogs.msdn.microsoft.com/premier_developer/2018/03/01/angular-how-to-editable-config-files/) – mutantkeyboard May 29 '18 at 12:04
  • @Nils what you're trying to achieve is to have static files on every of your environments, that are served to your clients to be used by javascript, right ? – Guerric P May 29 '18 at 12:12
  • If my understanding is good, then the approach is to serve the file with the HTTP server that you're using (maybe with symlink or other...). Then in your Angular app you'll be able to retrieve it via XHR or ` – Guerric P May 29 '18 at 12:16

0 Answers0