Once all data binding is completed and there are no more tasks for the Angular javascript to perform, I need to execute a function that toggles the display of certain divs.
Attempted Solutions
I want to avoid using timeouts:
The timing of Angular's completion is unpredictable, so using time intervals is not a reliable option.
I have also attempted app.run(function()....
, but it executes too early.
EDIT (for further clarification)
Consider a scenario with 2 divs:
<div class="static">SOME CONTENT</div>
and
<div class="angular">{{ someContent }}</div>
Initially, on page load, the user will see {{ someContent }}
until Angular has finished processing. My goal is to hide this angular div and only display the static div instead. Then, once {{ someContent }}
has been rendered, switch their visibility (i.e. hide static and show angular). This task seems simple and I'm considering using ng-show as a solution, but I am unsure about its implementation.