0

I have large html page with forms and tables built in angular.

The JS including loading other included templates, loading external JS files and aggregating data and formatting a large html table, it is fine.

But... it is just there is this time gap to display the final page. I don't mind being slow. Only I don't want to see a freezing screen.

I have tried :

angular element document.ready 
angular element window.load
$timeout(fn, 0)
data-ng-init
$scope.$on('$viewContentLoaded',fn)
$transitions (wrong idea)

None of them can fire any event to tell me the page is done loading. Or should it be called "decompressing"? Because it seems the Dom and Data are all in memory only it is not being displayed.

If I break apart ng-include and insert the duplicated columns by hand(quite a nightmare), I can see the page is sort of displayed in some incomplete shape quickly, freezing, the form elements are still taking time to load fully. then boom! it loads.

I am pondering to use a $interval now to detect some hidden element appears on page to show some evidence of page finished loading. But this is just feels not right.

Am I reaching some sort of limit of the HTML rendering? My table is about 1500 rows and 20 columns with inputs and selects elements.

angular.element(document).ready(function() {
    console.log("angular.element(document).ready");

});

$scope.$on('$viewContentLoaded', function() { 
    console.log("view content loaded");
});

angular.element(window).bind('load', function() {
    console.log("angular element window.load");
});

$window.onload = function() {
    console.log("window.noload");
};

Output

view content loaded
angular element window.load
window.noload
angular.element(document).ready

enter image description here

Hao
  • 6,291
  • 9
  • 39
  • 88
  • I think you are looking at this the wrong way. You should be looking at the `$digest` loop and how long it takes. See if this helps: http://stackoverflow.com/a/23066639/2495283 – Claies Apr 16 '17 at 18:10
  • Thanks. I uploaded the digest cycle. I don't really know what to look for. – Hao Apr 16 '17 at 18:22

0 Answers0