Angular's application module includes a run()
block which executes after the config()
function but before any controllers and directives are loaded.
Is there a way to execute something in the lifecycle after all controllers, directives, services, etc have finished loading?
I require this functionality to broadcast a message using my authorization pubsub service. I want to make sure that everything is fully loaded before publishing the message. Although I can verify authentication in the run block by checking local storage for a JWT using my authentication service, if I publish from the run()
block, there's no guarantee that everything has been loaded. I'm curious to know if Angular provides any feature like this or if I need to explore other solutions.
Thank you!