title: Filtering data in controller
body: <p>I am trying to filter my data inside of my controller:</p>
  
  <pre><code>MyApp.controller( 'MyCtrl', [ '$scope', '$filter', function( $scope, $filter )
  {
      $scope.elements = // array data;
  
      $scope.filterByUserSetting = function( element )
      {
          // return true/false depending on whether filter criterion matches
          // this part is fine
      }
  
       $scope.elementsFiltered = $filter("filterByUserSetting")($scope.elements);
      // this part doesn't work
  }]);
  </code></pre>
  
  <p>The error message I get is:</p>
  
  <pre><code>Error: [$injector:unpr] http://errors.angularjs.org/1.2.12/$injector/unpr?p0=filterByUserSettingFilterProvider%20%3C-NaNilterByUserSettingFilter at Error (native)...
  </code></pre>
  
  <p>How can I fix this?</p>