Have an object list
JS:
$scope.datas = [
{date:'06-12-2016', name : 'Pinao Class', state: 'archived', remark : 'remarled', amount : 101, id : 21},
{date:'15-04-2016', name : 'drivers Class', state: 'notarchived', remark : 'remarled', amount : 102, id : 22},
{date:'24-03-2016', name : 'Airplane Class', state: 'archived', remark : 'remarled', amount : 103, id : 23},
{date:'28-02-2016', name : 'burger Class', state: 'notarchived', remark : 'remarled', amount : 104, id : 24},
{date:'28-02-2016', name : 'burger Class1', state: 'notarchived', remark : 'remarled', amount : 104, id : 241},
{date:'28-02-2016', name : 'burger Class2', state: 'notarchived', remark : 'remarled', amount : 104, id : 2432},
{date:'28-02-2016', name : 'burger Class3', state: 'notarchived', remark : 'remarled', amount : 104, id : 2342},
{date:'28-02-2016', name : 'burger Class4', state: 'archived', remark : 'remarled', amount : 104, id : 2443},
{date:'28-02-2016', name : 'burger Class5', state: 'archived', remark : 'remarled', amount : 104, id : 2243},
{date:'28-02-2016', name : 'burger Class6', state: 'archived', remark : 'remarled', amount : 104, id : 2242},
];
$scope.paymentList = $scope.datas;
Have a filter using checkbox. The idea is to show all items with State:archived
My HTML :
<th><input ng-model="archived.state" type="checkbox"
ng-true-value="'notarchived'" ng-false-value="undefined">Show archived</th>
<tr ng-repeat="paymentinfo in paymentList | filter:keyword | filter:money | filter:getdate | filter:{state: archived.state}">
<td></td>
<td ng-click="singlepage(paymentinfo.id)" ><a></a> </td>
<td>
<div class="grey-flag remark-payment">
<div class="hover-remark"></div>
</div>
</td>
</tr>
Filter works reverse. When I check. show all notarchived elemets. need to show archived. When write like that
filter want's working work when I write just "archived" and it works when I write "notarchived", but it works reverse.
Aucun commentaire:
Enregistrer un commentaire