title: How Can I Clear The Selected Field In Input Using Angularjs?
body: <p>I am using MEAN stack in my application with AngularJS as my front-end. How Can I clear selected filed in input element,<a href="http://plnkr.co/edit/pwlZnMFG03TzOjrDzSfB?p=preview" rel="nofollow">My Plunker</a></p>
  
  <ul>
  <li><p>Look at my plunker for reference.</p></li>
  <li><p>I have used Start date and End date inputs , which is used to filter the <code>Due_date</code>. If we select Start Date like:- <code>16-09-2016</code> the data's has filtering in the table. </p></li>
  <li><p>In that date input has one <code>X</code> <code>close</code> button to clear the field, but which is not working, if we click that <code>x</code> clear button the table is showing like empty data's.</p></li>
  <li><p>What we excatly looking for , if we click that <code>x</code> clear button it's should to be clear selected fileds and need to display all datas in table ....like we have given the exaple plunker is here :- <a href="http://plnkr.co/edit/QuJvCXFpKbwVd0OlkHZ2?p=preview" rel="nofollow">http://plnkr.co/edit/QuJvCXFpKbwVd0OlkHZ2?p=preview</a>  for this plunker <code>x</code> clear button is working perfectly, I don't where I made a mistake,</p></li>
  <li><p>Please help us.</p></li>
  </ul>
  
  <p><strong>My controller for daterange filter:-</strong></p>
  
  <pre><code> .filter("myfilter", function() {
       return function(items, from, to) {
         var df = from;
           var dt =to;
             var result = [];   
               console.log(to);
              for (var i=0; i&lt;items.length; i++){
             var date = moment(items[i].invoice_date);
            date.add(items[i].terms,'d');
           var tf = date;
         if (date.isAfter(moment(from)) &amp;&amp; date.isBefore(moment(to)))  {
                      result.push(items[i]);
                  }
              }   
               //console.log(items);
              return result;
        };
      });
  </code></pre>
  
  <p><strong>My html :-</strong></p>
  
  <pre><code> &lt;input type="date" class="form-control" name="from" ng-model="from"&gt;
  
    &lt;input type="date" class="form-control" name="to" ng-model="to"&gt;
  </code></pre>
  
  <p><strong>Filter for daterange:-</strong></p>
  
  <pre><code>   &lt;tr ng-repeat="data in  record | myfilter:from:to"&gt;
  
      &lt;td&gt; {{addDays(data.invoice_date,data.terms) | date:'yyyy-MM-dd'}}&lt;/td&gt;
  
      &lt;/tr&gt;
  </code></pre>
  
  <p>I have created my plunker to reference :- <a href="http://plnkr.co/edit/pwlZnMFG03TzOjrDzSfB?p=preview" rel="nofollow">My Plunker</a></p>