I am facing a situation where my page needs to load data through multiple HTTP requests, followed by some logic execution in several directives within the same page.
I am currently using a boolean flag to indicate when the content has been loaded. Initially, I thought of using timeouts in these directives to check every second if the content is loaded and then execute the necessary logic. However, another idea that came up was to utilize broadcasting. Though I like this concept, it seems that due to closure scopes in these directives, broadcasting on the $rootScope might not be the most efficient approach.
Therefore, I am seeking advice on what would be the optimal solution for handling this type of task. Please share your thoughts on the best practice in such scenarios.