I have designed a small angular js based application. In that, whenever I navigate from one HTML page to another, I sometimes see HTML code of the new page being loaded for 1 or 2 seconds before that page renders completely. Like if the new page is coded like :
Name : {{personBean.name}}
Address: {{personBean.address}}
I am able to see the above code for few seconds before the page renders properly as it is suppose to be :
Name : Abhinav
Address : ABC, ...
This is happening in almost every scenario. Every page has its controller where logic of that page is coded in javascript (the way Angular works). It seems that the logic takes more time in execution while DOM gets already loaded and so HTML code sometimes gets displayed.
Can anyone please tell me how to overcome such issues? Can I make sure to get DOM loaded only after complete execution of the code present in the controller?