I'm starting using Angularjs. I have a simple project (HTML + javascript/Angular js). When I visualize the HTML file on my browser I see a second hidden elements. Do you maybe know the reason? How can I solve this?
Asked
Active
Viewed 624 times
0
-
2Can we see some code? – kzhao14 Nov 18 '16 at 16:45
-
Possible duplicate of [AngularJS strategy to prevent flash-of-unstyled-content for a class](http://stackoverflow.com/questions/16074673/angularjs-strategy-to-prevent-flash-of-unstyled-content-for-a-class) – spender Nov 19 '16 at 17:10
1 Answers
0
This problem is caused by the way Angular works. I guess that you are able to see the skeleton of angular (something like {{"your variable"}}) for a second and then the data is rendered to it. Your angular scripts are called once the page is loaded, so the delay in fetching data from server by your $http.get() methods causes the elements to appear without data. Thankfully, AngularJS has a simple solution to the problem in the form of ng-cloak directive. Refer the documentation for details.

divsingh
- 1,172
- 8
- 15