title: AngularJS Filter by Inline Expression
body: <p>I'm trying to add an inline Angular filter that filters via an expression that evaluates to true or false. Here's my JS:</p>
  
  <pre><code>angular.module('programApp', [
      'programApp.controllers',
  ]);
  angular.module('programApp.controllers', [])
      .controller('programController', ['$scope', '$filter',  
      function($scope, $filter){
  
        $scope.advancedFilters = 1;
  
        $scope.bars = [
          {'name':'First',
            'id':1},
          {'name':'Second',
            'id':2},
          {'name':'Third',
            'id':3},
          {'name':'Fourth',
            'id':4},
          {'name':'Fifth',
            'id':5}];
      }]);
  </code></pre>
  
  <p>And here's my HTML:</p>
  
  <pre><code>&lt;div ng-app="programApp" ng-controller="programController"&gt;
    &lt;label&gt;Level: 
      &lt;select ng-model="advancedFilters"&gt;
        &lt;option&gt;1&lt;/option&gt;
        &lt;option&gt;2&lt;/option&gt;
        &lt;option&gt;3&lt;/option&gt;
        &lt;option&gt;4&lt;/option&gt;
        &lt;option&gt;5&lt;/option&gt;
      &lt;/select&gt;
    &lt;/label&gt;
  
    &lt;div ng-repeat="bar in bars | filter:advancedFilters &lt;= bar.id"&gt;
      &lt;h3&gt;{{bar.name}}&lt;/h3&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>You can see how I'm trying to filter the bar ng-repeat based on what's in the advancedFilters dropdown. However, when I try and add a filter that evaluates to true or false to the ng-repeat, I get thrown an angular error. </p>
  
  <p>I would like to avoid creating a custom function in this situation. If possible, the filter should remain inline in the HTML.</p>
  
  <p>This seems pretty simple, but it isn't working. What am I doing wrong here? </p>
  
  <p><strong>Here's a codepen: <a href="http://codepen.io/trueScript/pen/LVZKEo" rel="nofollow">http://codepen.io/trueScript/pen/LVZKEo</a></strong></p>