My question revolves around a basic application that I have outlined: Angular scope not affecting ng-show as expected
The issue at hand is that my application exposes global variables, which is far from ideal.
I attempted to enclose the AngularJS code in a closure, but encountered errors in the browser indicating that the objects I was trying to access were inaccessible.
(function() {
// App code goes here
});
Is there a way for me to maintain the functionality of my app with the current structure while avoiding exposure of global variables? Or will I need to overhaul the entire architecture of my app to achieve this goal?
Ultimately, my aim is to minimize global variable pollution without having to drastically alter the layout of my app in both HTML and JavaScript.