title: Angular filter with minimum and maximum values
body: <p>I'm having some trouble getting angular to properly filter my results. I'm attempting to use a custom filter that gets arguments from a minimum input and a maximum input.</p>
  
  <p>/index.html</p>
  
  <pre><code>&lt;input ng-model="minHorsepower"&gt;
  &lt;input ng-model="maxHorsepower"&gt;
  ...
  tr(ng-repeat="plane in planes | filter:horsepowerFilter")
  </code></pre>
  
  <p>/controllers.js</p>
  
  <pre><code>//Horsepower filter
  $scope.horsepowerFilter = function(plane) {
    var ret = true;
  
    if($scope.minHorsepower &amp;&amp; $scope.minHorsepower &gt; plane.horsepower) {
      ret = false;
    }
  
    if($scope.maxHorsepower &amp;&amp; $scope.maxHorsepower &lt; plane.horsepower) {
      ret = false;
    }
  
    return ret;
  };
  
  $scope.planes = [
    {
        'make' : 'Piper',
        'model' : 'Arrow',
        'modelNumber' : 'PA-28R-180',
        'horsepower' : '180',
        'gear' : 'retractable',
    },
    {
        'make' : 'Piper',
        'model' : 'Arrow',
        'modelNumber' : 'PA-28R-200',
        'horsepower' : '200',
        'gear' : 'retractable',
    }
  ];
  </code></pre>
  
  <p>It works INITIALLY when I set $scope.minHorsepower/$scope.maxHorsepower in controllers.js, but only initially, not when I put something else in the <code>&lt;input&gt;</code>s. Furthermore, it prefills the inputs AND filters the results. It just doesn't work properly when I change the value of the inputs.</p>
  
  <p>I've referenced this Stack Overflow thread, but I can't find any material differences in our code... <a href="https://stackoverflow.com/questions/18792039/angularjs-multiple-filter-with-custom-filter-function">AngularJS multiple filter with custom filter function</a></p>
  
  <p>Thanks for the help.</p>