当前位置: 动力学知识库 > 问答 > 编程问答 >

AngularJS the directive appears when page is loading

问题描述:

I have the problem in FF, when page is loading, the directive appears till 2 seconds.

// controller

$scope.socketconection = false;

$rootScope.$on('SocketLost', function (event, data) {

$scope.socketconection = data; // true or false

$scope.$apply();

});

<div ng-cloak class="divs" ng-show="socketconection " ng-hide="!socketconection ">

Lost connection...

</div>

分享给朋友:
您可能感兴趣的文章:
随机阅读: