[英]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.