1
I have an object that indicates that the page is being loaded. However, it is not working properly, it follows code:
HTML:
<div class="fundo_login">
<div class="carregando_inicio" ng-if="carregando == true"> //Quando carregando for TRUE mostra o spinner
<img src="/provas/app/imagens/spinning-circles.svg"/>
</div>
<div class="box_login" ng-if="carregando == false"> //Quando for false, mostra o conteúdo.
<div class="painel_cadastro">
<div class="logo_fabet">
<img src="app/imagens/logo_fabet.jpg">
</div>
</div>
</div>
</div>
JS:
$scope.carregando = true;
$scope.acabou = function() {
$timeout(function(){
$scope.carregando = false;
}, 3000);
}
$scope.acabou();
Notice that caregando starts as TRUE so that soon the spinner appears, after 3 seconds its status is changed to FALSE, thus making disappear the spinner and appear the content. Parts of it are working. What is wrong is that when the page starts loading, the two appear together (for a few thousandths of a second), not respecting ng-if, as image below:
Another question, as I could do to disappear the spinner and show content only when the page is fully loaded?
You can post your full controller code?
– Jackson