When initializing a user session with specific data, I face the challenge of making sure that the session data is populated before it is required by certain directives in my application. Currently, I check if the local session data is empty on loading the main outer controller and fetch the data from the server if needed.
The problem arises when directives run before the scope is fully populated, causing issues within my app. It's not feasible for me to modify all directives to use promises or callbacks, so I have been looking for alternative solutions.
I have explored different approaches such as using UI router's grandfather state feature, but it still requires addressing the issue in each controller. Manually bootstrapping seems like an option, but populating the scope proves to be a challenge.
In my research, I haven't found a definitive solution to pause the Angular process until the required data is loaded. Suggestions such as global configuration exist, but I am unsure how to implement a pause without deferring bootstrapping.
If you have any ideas or suggestions on how to tackle this issue, I would greatly appreciate your input.