세 가지보기가 있습니다. nav, 주 내용, 바닥 글.다른보기가로드되기 전에 각도가 표시되지 않습니다.
메신저 나 ui-router를 사용하여 페이지가로드 될 때 nav 및 바닥 글이 즉시로드되지만 주 콘텐츠에는 일부 데이터를 가져 오기위한 요청이 있고보기가 nav 및 footer 이후 1 초 지연됩니다. 빈 중간 컨텐트로 잠깐 붙어 있습니다. 어떻게하면 모든 견해가 동시에 표시 될 수 있습니까?
<div ng-include="'client/template/nav.tpl.html'"></div>
<div class='main-wrapper'>
<div ui-view='' class='view'></div>
</div>
<div ng-include="'client/template/footer.tpl.html'"></div>
메인 컨텐츠 컨트롤러 :
function HomeController($scope, promos) {
$scope.products = products.data; // this is come from the server directly, not ajax
}
한 가지 메인 컨텐츠로 요청 된 데이터가 서버 요청 및 글로벌에서 온 아약스 요청에서없는 것을 알 수있다. 템플릿에
사용 NG-시계. – Ved
'해결'을 사용하고 싶을 수도 있습니다. http://stackoverflow.com/questions/11972026/delaying-angularjs-route-change-until-model-loaded-to-prevent-flicker – pixelbits
angularjs block-ui 모듈을 앱. 모든 데이터가로드 될 때까지 전체 페이지가 차단됩니다. https://github.com/McNull/angular-block-ui – Janty