title: how to pass param to a filter function in angular js
body: <p>I have two questions.</p>
  
  <ol>
  <li><p>how to pass param to a filter function.</p>
  
  <p>say for example:
  <code>item in masterData|filter1:masterdata|filter2:outputFromfilter1, myparam | filter3:outputFromfilter2, myparam1,myparam2</code></p></li>
  <li><p>how to access the controller <code>$scope</code> inside the filter function.</p>
  
  <pre><code>animateAppModule.filter( 'distinct' , function(){
      return function(masterdata){
          //HOW TO ACCESS THE $scope HERE
      }
  })
  </code></pre></li>
  </ol>
  
  <p>Here is a <a href="http://jsfiddle.net/9t62c/" rel="nofollow">fiddle</a>. Pls. look in to the firebug console, to see that the parameters passed to the filter is <code>undefined</code>.</p>