指定したフィールドでフィルタリングテーブルに問題があります。 Here`saテーブル画像: enter image description hereAngular.jsの指定した列でテーブルをフィルタリングする
テーブルのHere`sコード:
<div class="panel panel-default">
<div class="panel-heading">
<div class="btn-group" role="group">
\t \t \t \t <button type="button" class="btn btn-default" ng-repeat="years in history.yearbtn" ng-click="history.SelectYear($index=years.year)">{{years.year}}</button>
\t \t \t \t
\t \t \t </div>
\t \t </div>
<div class="panel-body">
<div class="container">
<table class="table">
<thead>
<tr>
<th>Amount</th>
<th>Kind</th>
<th>Month</th>
<th>Year</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="historys in history.data | filter:{}">
<td>{{historys.amount}}</td>
<td>{{historys.kind}}</td>
<td>{{historys.month}}</td>
<td>{{historys.year}}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="panel-footer">
<div class="btn-group" role="group" >
\t \t \t \t <button type="button" class="btn btn-default" ng-click= history.SelectMounth($index=mounth.mounth) ng-repeat="mounth in history.mounthbtn">{{mounth.mounth}}</button>
\t \t \t \t
</div>
</div>
</div>
とコントローラ用のコードをhere`s:
angular.module("CoinKeeperApp",[])
.controller('historyCtr',function() {
var self = this;
this.data = [
{amount:'200 USD',kind:'income',month: 'March', year:'2022'},
{amount:'214 USD',kind:'income', month: 'February', year:'2022'},
{amount:'2015 USD',kind:'income', month: 'June', year:'2017'},
{amount:'211 USD',kind:'expens', month: 'July', year:'2017'},
{amount:'213 USD',kind:'expens', month: 'December', year:'2015'},
{amount:'213 USD',kind:'expens', month: 'October', year:'2015'},
];
this.yearbtn = [
{year:'2022'},
{year:'2021'},
{year:'2019'},
{year:'2018'},
{year:'2017'},
{year:'2016'},
{year:'2015'},
];
this.mounthbtn = [
{mounth:'January'},
{mounth:'February'},
{mounth:'March'},
{mounth:'April'},
{mounth:'May'},
{mounth:'June'},
{mounth:'July'},
{mounth:'August'},
{mounth:'September'},
{mounth:'October'},
{mounth:'November'},
{mounth:'December'},
];
私が必要「年」列のみで表をフィルタリングします。角度フィルターを使って私はどのようにすることができますか?