title: Dependency injection in custom filters
body: <p>I'm new to angular and trying create a custom filter which requires a service. I followed the answer here <a href="https://stackoverflow.com/a/43506252/15817005">https://stackoverflow.com/a/43506252/15817005</a>. It solved my issue partially.</p>
  <p>Registering filter</p>
  <pre><code>angular.module('filters',[]).filter('dataFormat',['studentService', dataFormatFilter])
  </code></pre>
  <p>My Filter factory and filter function.</p>
  <pre><code>    export function dataFormatFilter(studentService){
  console.log(studentService); // Having access here
  return dataFormatFunction; 
  }
   
  function dataFormatFunction(name){
  // All the formatting logic
  
  //Need properties from studentService in this function.
  }
  </code></pre>
  <p>I am able to access the properties from studentService in dataFormatFilter(factory function). Is there a way to get it in dataFormatFunction.</p>
  <p>All the solutions i have seen use <code>dataFormatFunction</code> inside of factory itself <code>dataFormatFilter</code>. But i cannot follows this way.</p>
  <p>Thanks!</p>