如何隐藏< D​​IV>从视图中的元素,但还是老样子让他们占用空间AngularJS?视图、老样子、元素、空间

2023-09-13 05:10:57 作者:蹲在坟头吓鬼

我有以下内容:

   <div class="block-border">
       <div class="grid-select">
            <div class="clearfix">
               ...
               ...
            </div>
        </div>
   </div>

在形式方面是它们填充一旦屏幕加载数据的控制。而人口仍在进行中我有具有非零值的变量$ scope.loading。当负载完成这个值将是零。

On the form area are controls which are populated with data once the screen loads. While the population is still ongoing I have a variable $scope.loading which has a non zero value. When the load finishes this value will be zero.

有没有我能躲就&LT控件的方法; DIV CLASS =网格选择&GT; 所以他们是不可见的。请注意,我还是希望他们使用的空间,我仍然想显示块边界DIV。

Is there a way that I could hide the controls on the <div class="grid-select"> so they are not visible. Note that I still want them to use up space and I still want to show the block-border DIV.

推荐答案

尝试CSS可见性:隐藏; 是这样的:

<style>
 .hidden{
   visibility:hidden;
 }
</style>

<div class="grid-select" ng-class="{'hidden': loading!=0 }">

例如: http://jsfiddle.net/cherniv/YJ2R7/