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,6063 gold badges20 silver badges34 bronze badges
asked May 7, 2018 at 11:42
5
  • Possible duplicate of Reading environment variables with Javascript Commented May 7, 2018 at 11:45
  • So its not possible to fetch OS variable in JavaScript or is it not recommended ??? Commented May 7, 2018 at 11:58
  • You can during compile time of course, but not during runtime. See this article: medium.com/@natchiketa/… Commented May 7, 2018 at 12:36
  • Just pay attention that Angular is running on browser of the user, so do you wan to access user system variables? Commented May 7, 2018 at 13:28
  • Did you find a solution for this? Commented Jun 7, 2019 at 14:13

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.