As we make the switch to Angular.js for our webapp, we are faced with the challenge of storing global data. In the past, we used a global object called app
to store various functions and variables that needed to be accessed across different parts of the application. For instance, user data like name and avatar were stored in app.user
.
Now that app
is no longer just an object but an angular app module, we need to find the right way to handle global data in an Angular framework. It might require a completely different approach, which is why I want to ensure that we do it correctly.
My initial idea was to create something like app.global = {};
and use app.global
throughout the site. However, I am concerned about potential issues if the Angular API changes to include a property named global
. This could lead to significant challenges during future updates.