简体   繁体   中英

Hide element HTML when load AngularJS

I am a beginner in angularJS, and do not write good English.

在此处输入图片说明

在此处输入图片说明

I have the following code

 <span class="custom-marker-price" ng-bind="property.rentValue"></span>

How can I hide the element span (IMG1) when load angular...

Well, if im correct you should use ng-hide property. Inside of span after class add ng-hide='hideIt'

and inside of controller at first line put: $scope.hideIt=false;

And when you want to hide it just put boolean variable in true: $scope.hideIt = true;

You could also use ngif property.

Hope this help!

ngCloak

  • directive in module ng

The ngCloak directive is used to prevent the AngularJS html template from being briefly displayed by the browser in its raw (uncompiled) form while your application is loading. Use this directive to avoid the undesirable flicker effect caused by the html template display.

— AngularJS ng-cloak Directive API Reference

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