I really struggle with creating global variables in my Angular 2 application.
I already googled and read many posts on StackOverflow on this for the last 3 hours, h
Not really recommended but none of the other answers are really global variables. For a truly global variable you could do this.
..near the top right after imports:
declare const myTest: any;
...later:
console.warn(myTest); // outputs '1'