title: Filtering results in real time with AngularJS and MomentJS
body: <p>I have an ng-repeat listing results but I'm aiming to only display elements containing today's date.</p>
  
  <p>My current setup can do it, but needs a page reload to redefine the time variable and thus filter the results. </p>
  
  <p>To be honest I'm not sure that such real-time filter (when is 00.00 the list becomes empty automatically) can be accomplished, so I'd be very grateful if you could shed some light into the issue.</p>
  
  <p>Here's my current layout:</p>
  
  <pre><code>   &lt;div class="row msf-row" 
       ng-repeat="record in recordlist | filter: search | filter: record.date = dateJson " 
       ng-class="{ 'msf-cancelled': record.cancelled}"&gt;
        &lt;div class="col-md-1"&gt;{{record.date}}&lt;/div&gt;
        &lt;div class="col-md-1"&gt;&lt;strong&gt;{{record.car}}&lt;/strong&gt;&lt;/div&gt;
        &lt;div class="col-md-2"&gt;{{record.driver}}&lt;/div&gt;
        &lt;div class="col-md-2"&gt;{{record.from}}&lt;/div&gt; 
     &lt;/div&gt;
  </code></pre>
  
  <p>And the relevant JS:</p>
  
  <pre><code> $scope.dateJson = moment().format("YYYY MM DD");
   $scope.addRecord = function () {
      $scope.recordlist.push(
              {
                  date: $scope.dateJson, 
                  car: $scope.carList.code, 
                  driver: $scope.driverList.name,
                  from: $scope.locationList.place,
                  destination: $scope.locationList2.place, 
                  pax: $scope.paxList
              }
          );
     jsonToRecordLocalStorage($scope.recordlist);
  };
  </code></pre>
  
  <p>So basically, the filter compares the $scope.dateJson with the object property record.date and filters the results, but of course date.Json is only loaded on page reload, not on real time.</p>
  
  <p>Any inputs?</p>