redirection using angular Js giving a flickering effect

91 views Asked by At

I am using a angular JS application in which there is a redirection to a different HTML file.

Whenever a redirection occur and new page opens, there are some slight moments in which I can see the html code of the page.

I have used the ng-cloak of angular Js to avoid that, but later I came to know that Angular itself has not been loaded till the moment.

Can you please suggest the solution for the same so as to avoid this.

2

There are 2 answers

0
Carsten On

I usually solve this problem in my html as followed:

<div ng-if="data">
content...
</div>

Set $scope.data whenever your controller finishes.

0
veetesh jain On

I had experienced this flicker for header and nav bar and resolved that by initializing the header,nav object in angular service in RUN section of angular app. and created service to manager the header object like add,remove etc. make sure you never changes that header,nav object while redirection.