0
我有一個ul
與ng-repeat
,我試圖使一些值隱藏,當一個複選框未打鉤。基本上,我有一個JSON文件中的2個不同的狀態:new
和completed
。AngularJS,在複選框上的過濾器
我想要完成的時候顯示一個複選框被選中,並且當一個複選框未被選中時,它們將被隱藏。
我的代碼如下:
<div>
<input ng-model="$ctrl.query" placeholder="Search">
<input type="checkbox" ng-model="self.information">
<span> Show Completed </span>
</div>
<div class="container:fluid" id="list">
<ul>
<li ng-repeat="info in self.information |
filter: {'status': 'complete'}" ng-show="self.information">
<div class="row">
<!-- LI CONTENTS -->
</li>
</ul>
</div>
製作的jsfiddle總是讓別人更容易做出貢獻。 – Mahbub