简体   繁体   中英

Problems with ng-show in AngularJS

I have a problem whit ng-show or ng-if in AngularJS, because I have, for example, this code:

  <div id="publicidad-principal" ng-if="publicidadPrincipal"></div>

and in the controller I have the correct way:

  $scope.publicidadPrincipal = false;

Now, when I open the page, for a second i see the DIV and then it is hidden, my question is: are there any way to have the div all the time hidden? then you can push a button and show it, but this is not the problem.

You can try:

<div id="publicidad-principal" ng-show="publicidadPrincipal" ng-cloak></div>

And here is the documentation for ngCloak.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM