1

Is there any way to fetch operating system variables in Angular like Java and Path. same like we have in Node.js "process.env.JAVA".

I have tried googling it but everyone is saying create a file environment.ts but this is not my requirement, i need to fetch the System variable in Angular.

Thanks in advance.

Hitesh Kansagara
  • 3,308
  • 3
  • 17
  • 32
  • Possible duplicate of [Reading environment variables with Javascript](https://stackoverflow.com/questions/21315708/reading-environment-variables-with-javascript) – ibenjelloun May 07 '18 at 11:45
  • So its not possible to fetch OS variable in JavaScript or is it not recommended ??? – Anshul Mishra May 07 '18 at 11:58
  • You can during compile time of course, but not during runtime. See this article: https://medium.com/@natchiketa/angular-cli-and-os-environment-variables-4cfa3b849659 – Hinrich May 07 '18 at 12:36
  • Just pay attention that Angular is running on browser of the user, so do you wan to access user system variables? – Reza May 07 '18 at 13:28
  • Did you find a solution for this? – Madalina Jun 07 '19 at 14:13

0 Answers0