【发布时间】:2016-10-16 05:31:48
【问题描述】:
我的 JSON 数据中有一个订单数组,在我的列表页面上,我只想在找到搜索匹配项时显示下方的订单,而不是显示所有订单,就像我目前在下面的 gif 中一样我的搜索匹配。
在搜索之前我可以执行 ng-show/hide 来隐藏订单吗?
<ion-header-bar class="bar-dark">
<h2 class="title">Order List</h1>
</ion-header-bar>
<div class="bar bar-subheader item-input-inset bar-light">
<label class="item-input-wrapper">
<i class="icon ion-search placeholder-icon"></i>
<input type="search" ng-model="query" placeholder="Search">
</label>
</div>
<ion-content class="has-subheader">
<ion-list>
<ion-item ng-repeat="order in orders | filter:query" class="item-thumbnail-left item-text-wrap"
href="#/tab/list/{{order.bkur_user}}">
<h2>Production Name: {{order.bkav_name}}</h2>
<h3>Seatcount: {{order.bkur_seatcount}}</h3>
<h2>Order Subtotal: £{{order.bkur_subtotal}}</h2>
</ion-item>
</ion-list>
</ion-content>
【问题讨论】:
标签: javascript angularjs ng-repeat ng-show ng-hide