javascript - Angular JS filter by date not working -


i'm trying filter data in table shows me items entered on date, can't seem working. can see model being updated when select new date, data in table doesn't change.

html:

 <tr ng-repeat='file in files  | filter: date '> 

datepicker html:

<label>from:</label>    <p class="input-group" style="width:200px">     <input type="text" class="form-control" uib-datepicker-popup = "{{format}}" ng-model="date" is-open="status.opened"                                        min-date="mindate" max-date="maxdate" datepicker-options="dateoptions" date-disabled="disabled(date, mode)"                                        ng-required="true" close-text="close"/>         <span class="input-group-btn">           <button type="button" class="btn btn-default" ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button>         </span>   </p> 

controller:

(function ()  {   'use strict';   angular.module('aml-tech-dashboard.successful-emails').controller('datepickercontroller', function ($scope) { $scope.date = ''; $scope.status = {     opened: false };  $scope.format = "yyyy-mm-dd" $scope.mindate = new date(); $scope.dateoptions = {     //formatyear: 'yy',     startingday: 1 };  $scope.open = function ($event) {     $scope.status.opened = true;  };  $scope.date = new date();  });  })(); 

you should use object filtering.

<tr ng-repeat='file in files  | filter: date '>  $scope.date = {date: '2016-08-01'} 

and every 'file' must have field 'date'


Comments