Transferred from: https://www.cnblogs.com/e0yu/p/7219930.html?utm_source=itdadao&utm_medium=referral#undefined
When using angular JS, put AngularJS at the bottom of the file, when the page is rendered, there will be a flash of the situation:
Workaround one : Use Ng-cloak
<style type= "Text/css" >[ng-cloak]{display:none;} </style><body ng-app ng-init= "Name= ' Zhang San '" ng-cloak> {{name}}</body><script type= ' text/ JavaScript ' src= ' bower_components/angular/angular.js ' ></script>
Because execution is fast, the usual practice is to control it through classes:
<style type= "Text/css" >[ng-cloak],.ng-cloak{display:none;} </style><body ng-app ng-init= "Name= ' Zhang San '" class= "Ng-cloak" > {{name}}</body><script type= ' text/ JavaScript ' src= ' bower_components/angular/angular.js ' ></script>
Solution Two : Put the introduction of angular.js in front of head and load it in advance;
workaround three : Use Ng-bind
<body ng-app ng-init= "Name= ' Zhang San '" ng-bind= "name" ></body><script type= ' text/javascript ' src= ' Bower_ Components/angular/angular.js ' ></script>
Angularjs solve the data show a flash of the problem? -Solutions