I think a much simpler, adaptable approach would be to use the AngularJS call $http.pendingRequests.length . It returns a pending ajax call counter. Therefore, when it reaches 0 , you load the page.
You can create a directive that inserts a boot div (scrim) on any element, and then waits until all ajax calls are resolved, and then delete your counter.
Here's the meat of the code to make your AngularJS directive:
Note: $ .active is undocumented.
Stone Nov 05 2018-12-12T00: 00Z
source share