I have created a typescript project and I'm stuck with a problem who I can't find an answer. I would like to declare a global variable that can be read and modified by all the files in my project. Is it possible? And if yes, how can I do that? Thanks
Asked
Active
Viewed 28 times
0
-
1Why do you need to do this? – kelsny Mar 22 '22 at 19:00
-
Global variables (outside of a global namespace you create) are in general a bad idea in JavaScript for a variety of reasons- which this renders to - but it is done all the time. In a complex project this is likely to be a maintenance issue. – Mark Schultheiss Mar 22 '22 at 19:03
-
Please provide enough code so others can better understand or reproduce the problem. – Community Mar 23 '22 at 04:09
-
The goal is to create a buton in the main page to unable or disable a button in the side menu. And the unique idea that I have is to declare general variable. – lu11072002 Mar 23 '22 at 11:42