Angularjs This big kill device makes the implementation of the SPA (single page App) become unusually simple, its two-way binding so that the page content re-rendering without writing a large number of JS code, not to construct a DOM string ugly, as the need to quickly iterate, improve the user embodies the next generation of Internet applications, Angularjs can be said to have become one of the required technologies.
However, Angularjs also has a common problem with JavaScript, where the tag placeholder needs to trigger binding and rendering after the DOM is loaded and the JavaScript is loaded, which results in flashing when the page loads (the label is displayed before it is rendered out). Especially when the network speed is not ideal, seriously affect the user experience.
ANGULARJS provides two options to solve this problem:
1. Using the Ng-bind or Ng-bing-template property instead of the {{field}} placeholder, the default white space is displayed when initializing because the DOM property is not visible.
2. Use the Ng-cloak property or set the Ng-cloak style. The principle is that Angularjs adds a ng-cloak style to the head at initialization, which sets the display:none of the DOM, which is not displayed by default.
However, none of the two scenarios are ideal ng-bind or ng-bing-template cannot implement complex content representations, and modern browsers may still display the page before the Ng-cloak style is inserted into the head.
Final scenario: Add a Ng-cloak to the style sheet that is consistent with angularjs dynamic creation and statically loaded in the head
Angularjs Page Load Flicker Solution