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
-
Possible duplicate of Reading environment variables with Javascriptibenjelloun– ibenjelloun2018年05月07日 11:45:49 +00:00Commented May 7, 2018 at 11:45
-
So its not possible to fetch OS variable in JavaScript or is it not recommended ???Anshul Mishra– Anshul Mishra2018年05月07日 11:58:55 +00:00Commented May 7, 2018 at 11:58
-
You can during compile time of course, but not during runtime. See this article: medium.com/@natchiketa/…Hinrich– Hinrich2018年05月07日 12:36:36 +00:00Commented 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?Reza– Reza2018年05月07日 13:28:33 +00:00Commented May 7, 2018 at 13:28
-
Did you find a solution for this?Madalina– Madalina2019年06月07日 14:13:32 +00:00Commented Jun 7, 2019 at 14:13
lang-js