[英]Hide/show div using angularjs
它最初是隐藏的,在按钮上单击我想显示表行,这些表行又从WCF服务获取数据。 我刚接触过角形,因此无法在单击按钮时显示表格。 它闪烁并消失。
.html snippet
<div data-ng-hide="vm1.organizationNumber!=0 && !loading">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12 table-responsive">
<table class="table table-bordered table-condensed table-hover table-striped">
<thead>
<tr style="white-space: nowrap;">
<th>Organization #</th>
<th>Contract #</th>
<th>Plan #</th>
<th>Company Name</th>
</tr>
</thead>
<tr>
<td>{{vm1.organization}}</td>
<td>{{vm1.number}}</td>
<td>{{vm1.PlanName}}</td>
<td>{{vm1.EmployerName}}</td>
</tr>
</table>
</div>
</div>
</div>
</div>
这是一个示例:“ Switch”按钮将切换一个名为switch
的布尔变量,并且div将基于该变量的值被隐藏或显示。
<button ng-click="switch = !switch">switch</button>
<div ng-hide="switch"></div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.