Create an element with ng-if start hidden (so that it does not appear during page load)

When I want something to start as hidden with ng-show , you can simply add class="ng-hide" , so css will hide the element in advance. Thus, the item will not be displayed when the page is still loading

I want to do the same using ng-if , but I don't know how to do it

+5
source share
1 answer

As Michel suggested, using the ngCloak directive is a solution.
Just add ng-cloak to the class attribute of the tag that you want to keep hidden during application loading.

 <div class="ng-cloak">test</div> 

More details: https://docs.angularjs.org/api/ng/directive/ngCloak

+5
source

Source: https://habr.com/ru/post/1241633/


All Articles