Footer template blinks even using ng-cloak in AngularJS

后端 未结 3 1828
無奈伤痛
無奈伤痛 2020-12-16 19:44

I\'m sucessful create and display templates with some data retrieved from REST service using AngularJS but, when JSON response is still loading, the browser show the footer

3条回答
  •  感情败类
    2020-12-16 20:15

    ng-cloak and/or ng-bind can't help solve this problem, because this is not a "flash of uncompiled content" problem. Those directives are meant to hide content until Angular has had a chance to compile the HTML.

    The problem you are trying to solve is more like: "I'm adding stuff to the page dynamically and stuff is moving around". If you want to show the footer only after the main content is loaded, I like the solution @Alex presented in his comment.

提交回复
热议问题