0

Once you refresh the page in angular route environment,the specific view of that route will be loaded till the page dom has be loaded (after window.onload event).then it will cause a obvious delay that will make user feel uncomfortable.Is there any solution to make the view show immediately before the window.onload event? Thanks very much.

tereško
  • 58,060
  • 25
  • 98
  • 150

1 Answers1

0

You can show a generic loading screen using ng-cloak until the app is loaded. I can't think of any solution that will show the exact view you need for that page, without being extremely hacky.

docs: https://docs.angularjs.org/api/ng/directive/ngCloak

example: Creating a splash screen using ng-cloak

Community
  • 1
  • 1
haimlit
  • 2,572
  • 2
  • 22
  • 26
  • i've tried this and it does worked :).but the problem is it will not wait till the controller stuff of that view to complete.cuz i have some outer route change in the controller. – psychotich Jul 07 '14 at 14:41
  • hey seems i'v solved this problem,i put the outer view change code into resolve object of route,and the ng-cloak will wait till the resolve code finished.but i am wondering if you got any better solution yo :) – psychotich Jul 07 '14 at 17:11